On 8/1/03 11:44 AM, Mark J. Reed wrote:
> Is it possible with the new parameter declaration syntax to declare
> a mandatory name-only parameter?

My earlier plea for this feature begins here:

http://archive.develooper.com/[EMAIL PROTECTED]/msg14666.html

I didn't think I made much headway, but this...

On 8/1/03 5:52 PM, Damian Conway wrote:
> Probably.

...is encouraging :)

> I think that the '?', '*', and '+ prefixes are abbreviations for
> traits (C<is optional>, C<is List>, C<is optional is named>). So
> a named, mandatory parameter would be:
> 
> sub foo($bar is named) {...}

Good, but a single-letter prefix would also be nice :)

> Alternatively, you could just specify a mandatory parameter that has to be a
> Pair:
> 
> sub foo(Pair $bar) {...}
> 
> (though then you'd have to use C<$bar.value> for the value).

Ick.

-John

Reply via email to