in reply to Re^2: Strong typing and Type Safety.A multilanguage approach
in thread Strong typing and Type Safety.A multilanguage approach
From your earlier part:
The main difference, roughly speaking, between a strongly typed language and a weakly typed one is that a weakly typed one makes conversions between unrelated types implicitly, while a strongly typed one typically disallows implicit conversions between unrelated types.You then imply, in Example 2 in the "Weak Typing in Perl" section, that using the numeric + operator on a Perl string is "implicit" and therefore weakly typed. As chromatic once remarked:
What's implicit about using numeric operators on strings? If you use string operators on strings, you get string behavior. If you use numeric operators (which you must do explicitly), you get numeric behavior. What isn't explicit about that?Update: The same argument applies to your "Example 1" in that applying the Perl string concatentaion operator to a number is explicit. Perl is different (and superior IMHO) to many languages in that it does not overload + to mean both numeric addition and string concatenation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Strong typing and Type Safety.A multilanguage approach
by nikosv (Deacon) on Nov 20, 2010 at 08:23 UTC | |
by eyepopslikeamosquito (Archbishop) on Nov 20, 2010 at 10:47 UTC | |
by tye (Sage) on Nov 20, 2010 at 21:09 UTC | |
by chromatic (Archbishop) on Nov 22, 2010 at 00:12 UTC | |
by ikegami (Patriarch) on Nov 22, 2010 at 01:59 UTC | |
| |
by nikosv (Deacon) on Nov 20, 2010 at 15:40 UTC | |
by chromatic (Archbishop) on Nov 20, 2010 at 18:12 UTC |