Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Perl6 thread

Name: Anonymous 2011-01-09 22:35

There are too many ways to do it.

The completely backwards way:

> sub foo(&f) { f() }
{ "hi".say }.&foo();
hi


On the other hand, closures are much nicer now (JavaScript needs this):
> say (1,2,3,4,5).reduce: { $^a + $^b };
15

Note about .reduce: it only supports binary functions.

A note on operators:
Hyperops, eg: (1,2,3,4) «+» (5,6,7,8)
These are permitted to auto-parallelize (implementation dependent.)
Lazy meta-ops, eg: 1,2,3,4 Z+ 5,6,7,8
These support lazy evaluation. The result is generated as needed.
Reduction meta-ops, eg: [+] 1,2,3,4,5
Triangular reduction: [code][\+] 1,2,3,4,5 # result is (1,3,6,10,15)[code]
These are basically .reduce(*[b][i]op[/i][/b]*) with the binary operator provided.

Name: Anonymous 2013-06-04 17:06

>>6
http://perlcabal.org/syn/S03.html
cabal

http://en.wikipedia.org/wiki/Cabal
The term cabal derives from Cabala (a word that has numerous spelling variations), the Jewish mystical interpretation of the Hebrew scripture.
Shalom, Hymie!

Perl is now officially Jewish. And Larry Wall is a crazy kike, obsessed with Bible and Apocalypsis.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List