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

more new perl6 stuff

Name: Anonymous 2013-02-13 5:41

perlgeek.de/blog-en/perl-6/2013-pattern-matching.html

Name: Anonymous 2013-02-14 6:19

It's called destructuring bind and here's how it works in FIOC:

>>> stuff = [1, [2, (3, 4)], [5]]
>>> a, (b, c), [d] = stuff
>>> print a, b, c, d
1 2 (3, 4) 5

Note that tuples and lists can be freely mixed, on the LHS it doesn't matter which you use because no tuples or lists are actually created, that's just syntax, (but lists are sort of nicer because you don't have to deal with Python's (x,) wart), on the RHS any sequence-like type will do.

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