in reply to Re^8: Strong typing and Type Safety.A multilanguage approach (implicit)
in thread Strong typing and Type Safety.A multilanguage approach
You don't convert the value before passing it to the addition operator, so any conversion that occurs is implicit.
You can argue it that way, but what's the difference between:
$z = add( $x->to_int(), $y->to_int() );... and:
$z = $x + $y... given that the + operator always performs numeric addition? If it's the presence of explicit type name hints, your argument gets awkward in the presence of type inference.
... conversion implies loss of the original value.
I agree; that's why I try to prefer the term "coercion".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Strong typing and Type Safety.A multilanguage approach (implicit)
by ikegami (Patriarch) on Nov 22, 2010 at 02:44 UTC | |
by chromatic (Archbishop) on Nov 22, 2010 at 04:08 UTC | |
by ikegami (Patriarch) on Nov 22, 2010 at 08:34 UTC | |
by chromatic (Archbishop) on Nov 22, 2010 at 17:37 UTC | |
by ikegami (Patriarch) on Nov 22, 2010 at 18:03 UTC | |
| |
by ikegami (Patriarch) on Nov 22, 2010 at 08:31 UTC |