note
Abigail-II
Yes it is. Because it's awkward to write:
<code>
if ((COND1 || COND2) && !(COND1 && COND2))
</code>
specially when either condition is either expensive,
or has side-effects.
<p>
A while ago, I was writing a small script that recursively
compared directories (and no, plain diff didn't do, although
the script called diff repeatedly). Since I was interested
in the similarities instead of the differences, at one moment
I wrote:
<code>
next if -d $dir1 xor -d $dir2
</code>
<p>
If either of the arguments wasn't a directory, but the
other was, they couldn't match. But if both were, or both
weren't, furthermore analysis was necessary.
<p>
And yes, I know, <tt>xor</tt> can be written using other
primitives as well. But that's not an argument, unless you
also think 'for', 'while' and other looping constructs
are redundant, because we have 'goto'.
<p>
Abigail
273853
273853