Glenn Linderman writes:
: Why not
:
: @foo = @( a + b ); # element by element add of @a and @b
I expect that's be written:
@foo := @a + @b;
where the := says to treat the left side as a prototype, and a bare
array in a prototype is going to put scalar context on the right side,
and a + in scalar context is going to do the right thing with arrays
in scalar context. It's possible that a bare = could be made to work
too, but it implies copying a list, where := only implies copying
a pointer.
Larry
- Re: Tying & Overloading Stephen P. Potter
- Re: Tying & Overloading Nathan Wiger
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading Austin Hastings
- Re: Tying & Overloading Austin Hastings
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading Glenn Linderman
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading Graham Barr
- Re: Tying & Overloading Buddha Buck
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading Simon Cozens
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading John Porter
- Re: Tying & Overloading Bart Lateur
- Re: Tying & Overloading Simon Cozens
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading John Siracusa
- Re: Tying & Overloading Larry Wall
- Re: Tying & Overloading Larry Wall
