develooper Front page | perl.perl6.language | Postings from September 2002

Re: Regex query

From:
Luke Palmer
Date:
September 23, 2002 19:24
Subject:
Re: Regex query
Message ID:
Pine.LNX.4.44.0209232020200.410-100000@babylonia.flatirons.org
On 24 Sep 2002, Simon Cozens wrote:

> fibonaci@babylonia.flatirons.org (Luke Palmer) writes:
> > 	push @a: [1,2,3,4];
> > 
> > pushes an array ref onto @a.
> > 
> > 	push @a: *[1,2,3,4];
> > 
> > pushes 1, 2, 3, and 4 onto @a (as it would without the * and []).
> 
> Remind me which language this is supposed to be, again?

Heh, I see your point.  Though the first of these two isn't so non-perly.  
The second, people wouldn't do at all: they'd leave off the *[ ] 
altogether.

BTW, the colon is indirect object, remember?  The first is equivilent to:

	@a.push [1,2,3,4];

Since I assume push is going to be a method now.

As far as the brackets-as-list thing, I think it has been discussed 
ad nauseum, and I'll leave it to the heavyweights to sort it out.

Luke




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About