I hate to bring this back up, but I'm designing bits of the internal api at
the moment, so this is an issue.
I'd like to have some sort of support for doing things like:
@a = @b || @c;
where @a is as big as the biggest of @b and @c, and for any individual
entry, will be the value from @b if its true, and @c if its not.
Unfortunately this has some short-circuiting issues and strong feelings
abound, and I'd just as soon not stir that up again. I *still* want the
feature though.
Given that, would anyone object to the _binary_ operators being used
instead? They don't have short-circuit semantics, and generally don't have
any reasonable meanings for hashes and arrays. With that, instead of
writing the above code, you'd write:
@a = @b | @c;
nothing short-circuits but then you don't expect it to, and that's more or
less OK. The and operation would likely return the left-hand value if both
are true, and xor would return whichever of the two were true, or undef of
both (or neither) were true.
For hashes, presumably we'd run through the keys of each hash, and missing
keys would translate to false values.
Objections, anyone? (I don't feel that strongly about it being a visible
language feature, so if folks really dislike it I'll withdraw the
suggestion and quietly slip the feature in anyway where nobody can see it... :)
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk