Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Using ternary operator as lvalue in push

by dada (Chaplain)
on Aug 02, 2007 at 14:51 UTC ( #630289=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using ternary operator as lvalue in push
in thread Using ternary operator as lvalue in push

well, I also expect something like this to work in Perl 6:
($cond ?? @x :: @y).push(<a b c>);
which is a lot more understandable syntax in my opinion.

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

Replies are listed 'Best First'.
Re^4: Using ternary operator as lvalue in push
by polettix (Vicar) on Aug 02, 2007 at 14:57 UTC
    As a matter of fact it does:
    pugs$ cat prova.pl && ./pugs prova.pl my @x = my @y = (); ((False,True).pick ?? @x !! @y).push(<a b c>); say "x: @x[]"; say "y: @y[]"; x: a b c y:
    At least now!

    Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Don't fool yourself.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://630289]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (None)
    As of 2022-01-26 06:11 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      In 2022, my preferred method to securely store passwords is:












      Results (69 votes). Check out past polls.

      Notices?