On 6/18/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
Is there a construct in Perl 6 to express this more immediately? Something along the lines of the following would seem ideal:$foo, $bar, ( $baz if $wibble ), $quux
How about this:
pugs> sub infix:<pv>($x, $cond) { $cond ?? ($x,) !! () }; say 1, 2,
(3 pv 1), 4
1234
bool::true
pugs> sub infix:<pv>($x, $cond) { $cond ?? ($x,) !! () }; say 1, 2,
(3 pv 0), 4
124
bool::true
I couldn't think of a good name for the new operator, though.
Stuart
