[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Testing list?



Uri Guttman wrote:
> 
> so you have a scalar and array context being applied to @a at the same
> time. not nice.
> 
> so it makes sense to me for it to be a compile time error.

I would think it would be reasonable for this funky operator
to work as long as the LHS can be BOTH
1) evaluated as a boolean expression
2) assigned to as a list

Since @a is probably the simplest case that meets both
criteria, I think it ought to be legal.

And I guess it would also mean this should work:

    my( $a, $b, $c ) = foo();
    ( $a, $b, $c ) ||= ( 1, 2, 3 );

and this:

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

and:

    @a = foo();
    splice( @a, 2, 3 ) ||= ( 1, 2, 3 );

and:

    ( @everything, $pred ) ||= genlist();
    # same as:
    $pred or @everything = genlist();
    # right?  

-- 
John Porter

"There are people who have fun studying the C++ spec for
literally seconds on end, I'm sure..."    John Vlissides


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe