> Date: Wed, 20 Nov 2002 12:11:52 -0800 (PST)
> From: Austin Hastings <[EMAIL PROTECTED]>
> 
> 
> --- Larry Wall <[EMAIL PROTECTED]> wrote:
> > ...
> 
> > This might work now, presuming
> > 
> >     sub foo (;$_ = $=)
> > 
> > (or whatever) is really a binding, and not an assignment.  (That's
> > another reason why //= is *wrong*--it implies assignment.)
> 
> Umm, that's what it was supposed to do.
> 
> IOW:  sub($param //= $=) 
> 
> means "if you don't get one, grab the value of $=."

More like "if you don't get one, bind to $="

Copying stuff should always be explicit, as it can take awhile.  I'm
wondering how //= implies assignment while = doesn't.  But I tend to
like = better anyway.  And using := :

    sub foo ($param := $=) {...}

Just feels wrong.  I guess there was no point to what I just wrote...

> As opposed to sub($param ://= $=)
> 
> which would be a horrible-looking way of getting something by
> reference.

Using an operator that doesn't exist.

> Which is also why I asked about value/reference semantics.
> 
> Or is ";" supposed to be the "here be reference-args" delimiter? (I
> thought it meant "here be named parameters"...)

Neither.  It means "here be optional parameters." Just like Perl 5.

Luke

Reply via email to