Flattening lists
Sometimes we need to group things based on context
Example:
my @a = 5,6; my @b = 1, 2, (3, (4, @a)), 7;
Q: How many elements does @b have?
- a. 4
- b. 6
- c. 7
- d. other
Perl 6 | Perl 6 Lists, Arrays, and Hashes vivified | #40 |
Sometimes we need to group things based on context
Example:
my @a = 5,6; my @b = 1, 2, (3, (4, @a)), 7;
Q: How many elements does @b have?
Copyright © 2011 http://www.pmichaud.com/2011/pres/ |