4 ms·
Reminds me a lot of Arc's square bracket syntax: [* _ 2] becomes (lambda (x) (* x 2))
by noahlt 14y ago
Reminds me a lot of Arc's square bracket syntax:
[* _ 2]
becomes
(lambda (x) (* x 2))
- draegtun 14y agoDitto Whatever-star from Perl6 which is more akin to Scala's underscore but using an asterix (http://perl6advent.wordpress.com/2009/12/19/day-19-whatever/ http://perl6advent.wordpress.com/2009/12/19/day-19-whatever/) Here's the Ruby examples in perl6 (all work in Rakudo)... [10, 11, 12].map: (* + 87).chr; @owners.map: *<name>; "alpha\nbeta\ngamma\n".lines.map: *.uc; NB. A limited version of Whatever-star is also available for perl5 - https://metacpan.org/module/Whatever https://metacpan.org/module/Whatever