I'm probably opening up a whole new can of worms here, but if we said that the
following were both vector operators:

        ^ == intersection operator
        v == union operator

then these could have potentially useful meanings on their *own* as set 
operators, as well as modifying other operators. For example:

@a = (1,2,3);
@b = (4,1,3);

@a = @a ^ @b; # @a = (1,3);
@a = @a v @b; # @a = (1,2,3,4);

ie @a = @a ^ @b; means

grep($MARK{$_}++, @a);
for @b { push (@result, $_) if ($MARK{$_} && !$MARK2{$_}++); }
@a = @result;

----

@a = @a v @b; means

grep( $MARK{$_}++, @a );
@result= @a;
for @b { push (@result, $_) if (!$MARK{$_}++) }

----

I know that this is far more useful behavior than the currently proposed meaning
of @a ^= @b... even though if its a little off kilter with the other meanings:


@a = (1,2,3);
@b = (4,1,3,5);

@a ^+= @b;  # (5,3,6);
@a v+= @b;  # (5,3,6,5);

etc. etc.


Ed

Reply via email to