Re: is it required to use type declarations? (was Re: 'hashkey context/Str context')

2002-12-12 Thread Dave Storrs
On Wed, Dec 11, 2002 at 12:13:49PM -0700, Luke Palmer wrote:
  [Dks wrote:]
  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?
 
 Optional by request, but not explicit request.  If you type a
 variable, you're asking for type checking on that variable.


Excellent.  That's the best of all worlds.  Thanks; I am much relieved.

--Dks



is it required to use type declarations? (was Re: 'hashkey context/Str context')

2002-12-11 Thread Dave Storrs
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