Why not
@foo = @( a + b ); # element by element add of @a and @b
or even
@( foo = a + b ); # element by element add of @a and @b assigned to
@foo.
I guess one could claim the idea is similar to the old BASIC MAT prefix,
although it was clearly reached by a different path. This could also
address the Highlander variables, to some extent.... leaving in today's
variable prefixes $, @, and %, one could factor out a certain amount of the
line noise in some circumstances via
$( foo = a + b ); # scalar addition of $a and $b, assigned to $foo
And for hashes, corresponding element addition...
%( foo = a + b );
If (keys %a) and (keys %b) do not produce the same list, it would be
expected that (keys %foo) would be the union, addition would be done on the
common keys, and the unique keys wold be copied. If you want %foo to get
the intersection, you could do something like
%( foo = a{keys %b} + b{keys %a}); # remember, the % context gets
distributed
Austin Hastings wrote:
> Okay, then:
>
> @foo = @( @a + @b ); # @(), $(), and %() set context.
>
> Easier to identify the operators, and little or no question about the
> context...
>
> --- Larry Wall <[EMAIL PROTECTED]> wrote:
> > Stephen P. Potter writes:
> > : Maybe this is a crazy (or stupid) idea, but why couldn't we use the
> > $, @,
> > : and % characters?
> > :
> > : @foo = @a @+ @b; # element by element add
> >
> > Because it's difficult to tell the operators from the terms visually.
> >
> > Larry
>
> =====
>
> Austin Hastings
> Global Services Consultant
> Continuus Software Corporation
> [EMAIL PROTECTED]
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
--
Glenn
=====
Due to the current economic situation, the light at the
end of the tunnel will be turned off until further notice.