develooper Front page | perl.perl6.language | Postings from March 2005

Re: Referencing a caller's slurpy array.

Thread Previous | Thread Next
Larry Wall
March 16, 2005 10:01
Re: Referencing a caller's slurpy array.
Message ID:
On Tue, Mar 15, 2005 at 01:54:09AM -0600, Rod Adams wrote:
: A06 says:
: If you |shift| or |pop| without an argument, it shifts or pops whatever 
: slurpy array is in scope.
: Shall we assume that @_ is always an alias for this array, so I can say 
: something like:
:  multi sub pop (Array ?@array = @caller::_) returns Scalar
: ?

Well, the alternative would be to have an explicit compiler variable like
@?SLURPY, but maybe using @_ for that is more parsimonious.

: btw, is ?@ legal in a signature? It's not specifically mentioned in 
: A/S04, but it makes sense it would be allowed along with ?%.

Certainly.  The zone markers are as orthogonal to sigils as we can
make 'em.  Though I'm not sure we've given a meaning to *&foo yet.
I suppose that would have to mean that the next slurpy parameter has
to be a sub ref.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About