At 06:59 AM 8/26/00 -0600, Tom Christiansen wrote:
>[I know this is not your quote, but your quotee's quote]
>
> >> There is obviously no need to modify the behavior of the C<&&> operator.
>
>Is one wholly certain of this?
>
> DB<1> @c = (1..3)
> DB<2> @a = @b && @c
> DB<3> x @a
> 0 0
> DB<4> x @b
> empty array
Urp. (tap, tap, tap ... v2 ... tap, tap, tap)
>It would appear that altering &&/|| on LHS context would entail,
>in the list assignment scenario, calling that operand in list context
>and then deciding whether it were true or not by some "intuitive"
>means (almost certainly by using whether its element count were
>zero or non-zero). You'd have to squirrel away those list values
>first to avoid re-evaluation, but this does not seem unduly onerous.
Yup. I'm aware of the irony of turning something that was fairly
rigorously defined (left hand has to be evaluated for truth, therefore
scalar context) into yet another special case, but I believe that the vast
majority of people won't penetrate to the irony and it will simply appear
more consistent. If anyone has written a subroutine that does such
different things in each context that it would be broken by this, well, I
would like to see that code and ask them a few questions...
--
Peter Scott
Pacific Systems Design Technologies