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 2011-01-09 23:23

Jesus, this is crazier than even I expected

Name: Anonymous 2011-01-10 1:40

>>1
i liek perl6 cuz it reminds me so much of haskal hahahahahahahaha lol ^___^ i rly liek haskal (and i'm from /g/ hahaha nice to meet u haha lol hahahahaha lol)

Name: Anonymous 2011-01-10 2:25

>>1-
Do you understand why I say that Perl 6 has an operator for everything!, now?

Name: Anonymous 2011-01-10 6:02

say "hi";

Name: Anonymous 2011-01-10 10:14

>>4
I wouldn't go so far as to say it has an operator for everything, but it does have three operators for nothing:

{ ... }
{ !!! }
{ ??? }
(nullary, of course)

http://perlcabal.org/syn/S03.html

Name: Anonymous 2011-01-10 11:04

>>4
NB. whatever-star is not classified as an operator. I think it's classified as a type in the auto-currying form.

Name: Anonymous 2011-01-10 11:15

>>6
I praised the power of Perl's Yada Yada Operator many times.
It is actually useful:
1. Your sub function { ... } example codes will be actual VALID Perl 6 CODE.
2. When you're working on a complex function, you can implement part of it later, using The operator on that branch:
if (something) {
    ...; //TODO: we've got something, what to do?
} else {
  // Let me work on this first
}

3. It's cute.

>>7
I think it can be classified as meta-operator, like «»/»«.

Name: Anonymous 2011-01-10 11:18

>>6
The lol contextualizer

Name: Anonymous 2011-01-10 11:21

>>6
infix:<andthen>
It's not the same of Haska l's >>?

Name: Anonymous 2011-01-10 17:14

I for one would like to see the Hammer operator become more prominent.

--;

Name: Anonymous 2011-01-10 21:37

>>11

What does it do?

Name: Anonymous 2011-01-11 1:18

>>12
it mobilizes ur dorfs to reduce the preceding object by one unit after evaluation

Name: Anonymous 2011-01-11 1:25

These support lazy evaluation. The result is generated as needed.
No CSE, no sharing, just call-by-name.  Certain people fucking hate that myth that you can add some sort of primitively deferred computation to a strict applicative-order language and add "lazy evaluation" to your feature list.

Name: Anonymous 2011-01-11 1:45

>>14
Certain people need to get their heads out of their dog's ass.

Name: Anonymous 2011-01-11 2:38

>>15
U MENA HASKAL!

Name: Anonymous 2011-01-11 8:51

>>1
BSD vs System-V

Name: Anonymous 2011-01-11 8:52

>>17 fuck wrong thread

Name: Anonymous 2011-01-11 9:07

>>15
They did, after the said dog died ;_;

Name: Anonymous 2011-01-11 11:21

>>14
Take it up with Larry Wall. No really--you can, he hangs out on IRC all the time. And I don't mean that in the "go away" sense, I mean it in the We're doing The Whirlpool-Larry Wall sense, i.e. if you can make a good point about it the spec and implementation will be revised.

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