|
|
Subscribe / Log in / New account

Perl6's ^^

Perl6's ^^

Posted Feb 17, 2015 20:27 UTC (Tue) by marcH (subscriber, #57642)
In reply to: Perl6's ^^ by mbunkus
Parent article: Scalar typing in the PHP world

> Short-circuiting is not just about side-effects, it's also about efficiency. Even completely side-effect-free functions can be costly to run.

Of course. Any answer to the question I did actually ask?


to post comments

Perl6's ^^

Posted Feb 17, 2015 21:37 UTC (Tue) by mbunkus (subscriber, #87248) [Link] (1 responses)

Sorry about that. I honestly didn't know and had to compile Rakudo Star (Perl 6) first in order to give it a try. And yes, you can cause all three terms to be evaluated by using parenthesis this way:

perl6 -e 'sub a{ say "moo"; 1 }; sub b{ say "yay"; 1 }; sub c { say "stuff"; 1 }; a() ^^ (b() ^^ c())'

This will output all three strings and not just the first two.

Perl6's ^^

Posted Feb 17, 2015 22:55 UTC (Tue) by marcH (subscriber, #57642) [Link]

> I had to compile Rakudo Star (Perl 6) first in order to give it a try.

Thanks, really appreciated.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds