On Tue, May 04, 2004 at 04:14:44PM -0600, Luke Palmer wrote:
> Dov Wasserman writes:
> > Since in the rest of Perl 6, the '~' operator involves string
> > representation, perhaps the standard +$foo marker should really be ~$foo:
> > i.e., $foo only has a (string) name, not a numeric position. Thus ~$foo
> > would mean exactly what +$foo currently means: $foo may only be passed by
> > name, and it is optional.
> 
> Hmm... I'm quite sure that I like ~ better than + for mnemonic purposes.

I agree.

> > Declaring a parameter to be named-only would now require a different syntax.
> > For your parametric perusal pleasure:
> > 
> >     1. sub foo($req1, ?$opt1, ~$optNamedOnly, ~$reqNamedOnly is req) {...};
> >     2. sub foo($req1, ?$opt1, ~$optNamedOnly, +$reqNamedOnly) {...};
> >     3. sub foo($req1, ?$opt1, ~?$optNamedOnly, ~$reqNamedOnly) {...};
> >     4. sub foo($req1, ?$opt1, $optNamedOnly is named, $reqNamedOnly is named
> > is req) {...};
> 
> I'm for option 1. 
[ well-reasoned  ... um ... reasons elided ]
> On the other hand, Perl's always been a purist in impurity.  There are
> more subtle reasons for wanting to add a required named parameter.
> Adding the => syntax to a method call, while the parameter isn't
> formally named, can be a useful language building idiom.  That's why I
> support the C<is req[uired]?> trait.  But making a special character
> sequence for it will end up confusing people, being mishuffmanized.

I agree here too.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]

Reply via email to