Talk:Language Comparison Table: Difference between revisions

m
(→‎Perl 6 - Strongly typed: yes, according to the definition given)
m (→‎Perl 6 - Strongly typed: (forgot siggy))
Line 192:
:The expression in question does work by default, but not because of any implicit coercion within the actual addition operator, well, operators, really, since they're multi subs, which have signatures that know how to add integers, rationals, floaters, etc. But they don't do implicit coercion; instead, we use "mechanisms resembling weak typing" to define allowable coercions. There is a specific generic signature that allows coercion of strings to numeric, after which the appropriate numeric operator is applied. These signatures are defined in a magical outer lexical scope called the setting, and are ostensibly written in Perl 6, apart from the places where circularity must be broken by use of primitives. (A setting is allowed to cheat as long as everything in the setting ''appears'' to be written in Perl 6.)
:Any or all such overloaded signatures may therefore be shadowed in an inner scope, including the coercive generic signatures. One of the strong design principles of Perl 6 is that every lexical scope know exactly what language it is using, where "exactly" does not preclude genericity, but only accidental genericity. Therefore lexical scoping is how we override anything in the outer language and produce a new language in an inner lexical scope. Since Perl 6 is designed to be completely mutable in this sense, such an inner language can appear to be as weakly typed as you like, but since all of the outer primitives are, in fact, strongly typed, Perl 6 is better characterized as strongly typed.
:But finally, I'd like to point out that the very first thing the definition in question says is that type strength is a "vague term". <tt>:-)</tt> --[[User:TimToady|TimToady]] 23:44, 13 September 2011 (UTC)
Anonymous user