Front page | perl.perl6.language |
Postings from September 2002
Re: Regex query
From:
Trey Harris
Date:
September 23, 2002 22:46
Subject:
Re: Regex query
Message ID:
Pine.BSF.4.44.0209240129050.35599-100000@bowser.eecs.harvard.edu
In a message dated 24 Sep 2002, Aaron Sherman writes:
> This is because push is
> almost certainly defined as:
>
> sub push(@target, *@list) { ... }
That should be
sub push(@target is rw, *@list);
but otherwise I think that's right.
Now, implementation in Perl 6 (though I assume it's actually written in
Parrot). This would obviously work:
sub push(@target is rw, *@list) {
@target[@target.length ..
@target.length + @list.length - 1] = @list;
}
Now, how to do it more Perlishly?
@target = *(@target, @list);
? Or would that have to be
@target = (*@target, *@list);
? Surely
@target = (@target, @list);
or
@target = (*@target, @list);
would not work. Or would it?
Trey