On Wed, Oct 26, 2005 at 04:02:06PM +0200, Juerd wrote:
: Larry Wall skribis 2005-10-26  6:44 (-0700):
: > I should point out that one of the major changes in the most recent
: > S6 is that named arguments are now marked by : rather than +, with
: > :foo($bar) being the way to declare parameter $bar but give it the
: > external name of "foo".  A + is now reserved to mark mandatory
: > parameters, though it's redundant on positionals.  A mandatory
: > named parameter is now marked +:$nonoptionaloption.
: 
: If optional parameters get "?", then why don't give mandatory parameters
: "!"?
: 
: Or, if you wish: if mandatory parameters get "+", then why do optional
: parameters not get "-"?
: 
: # The mandatory/optional thing could even be postfix, which results in
: # clearer code than the stacked "+:$":
: # 
: #     sub foo ($this!, $is!, :$mandatory!, $optional?, $really?)
: 
: I do like the s/+/:/ change, though!

That's interesting.  Then we could say that "= default" implies ?.
I think I like it.  It would also ease transition of Pugs not to change
the meaning of + immediately, but that's a secondary consideration.
And really, + ought to mean a * but with a minimum of 1.

Larry

Reply via email to