On Mon, Dec 09, 2002 at 03:58:54PM -0700, Luke Palmer wrote: > > From: Dave Storrs <[EMAIL PROTECTED]> > > My understanding was that in Perl6, you could use pretty much anything > > for a hashkey--string, number, object, whatever, and that it did not > > get mashed down into a string. Did I have this wrong? > > By default they're keyed by strings. You can smack a property on them > to key them by something else, though: > > my %sparse is keyed(Int); > my %anything is keyed(Object); # or UNIVERSAL
Hmmm...maybe this is a good time to bring up something that's been bothering me for a while. It seems like Perl6 is moving farther and farther away from Perl5's (almost) typelessness. All of a sudden, we are getting into ints, Ints, Objects, Strs, etc...more and more of the code examples that are being posted to these lists use type declarations in method signatures, variable declarations, and anywhere else that they might squeeze in. It isn't clear to me if this is being done because we are currently discussing the new types and type-safety mechanisms--all of which are optional, and only come into play when you request them--or if it is expected that this will be the new paradigm for Perl programming. So...are we intending that types and type safety will be like 'use strict' (optional and only on request), or will they be like sigils (mandatory, can't be turned off)? Or, perhaps, on by default but able to be turned off? --Dks