A note about .elems
> say @a.elems;
The elems function tends to make things non-lazy
This includes unary + on arrays
Avoid things like:
if +@a { say '@a is not empty' }
# ...and it's no longer lazy!
continued...
| Perl 6 | Perl 6 Lists and Arrays vivified | #34 |
> say @a.elems;
The elems function tends to make things non-lazy
This includes unary + on arrays
Avoid things like:
if +@a { say '@a is not empty' }
# ...and it's no longer lazy!
continued...
|
Copyright © 2012 http://www.pmichaud.com/2012/pres/ |