Jeremy Howard writes:
> It seems obvious that @a should be the whole array @a, not the size of the
> array. If I want to check the size of @a, I should have to do so explicitly,
> with scalar or $#.
It depends. Which interpretation depends on which action you'll want
most often.
> @result = @b unless @result = @a;
I think this is much more common than or-ing individual values. I can
think of many times in my programs where I've written:
@foo = @a ? @a : @b;
The only time I can think of a distributive || being useful is:
($a, $b, $c) ||= ($a_default, $b_default, $c_default);
I think the logops should be special-cased.
That said, given that both have utility, and if no convincing cases of
breakage can be found, I wouldn't mind it too much. It'd just be
another weird context-dependent thing to explain to students.
Nat
(I seem to have talked myself around 90 degrees :-)