How about adding a new keyword, hmm, 'yield'. :-)

        if ( grep yield $x==$_, (1,2,3) ) ...

<chaim>

>>>>> "DC" == Damian Conway <[EMAIL PROTECTED]> writes:

>> Oh, the table thing. The switch statement is useful without learning the
>> complete table so I don't think complexity is a big problem. People can
>> learn what they need and ignore the rest. I agree with you that it might
>> be nice to have an array membership operator (like "in") so that you can
>> write:
>> 
>> if ($x in [ 1, 2, 3 ]) ...

DC>        if ( grep $x==$_, (1,2,3) ) ...

DC> Be nice if it would short-circuit in a boolean context though!

DC> Damian




-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183

Reply via email to