Front page | perl.perl6.language |
Postings from October 2006
October 8, 2006 07:08
Message ID: 20061008140737.GJ25805@c4.convolution.nl
S03 says that hypers recurse into subarrays.
That's a nice and useful feature, but that not-recursing is even more
useful. Especially given that many objects will probably does Array, you
want to be explicit about recursion.
S03 doesn't give a way to avoid recursion.
I suggested on #perl6 that standard hypers do not recurse, and a new
operator: double hypers. These are the same, but they do recurse. From
my point of view, hypers should operate on lists, not arrays. Recursive
hypers would work on arrays because arrays are single element lists.
It would probably be useful to allow combinations of recursive and
»+« # do not dive into arrays
»»+«« # do dive into arrays, on both sides
»+«« # dive into arrays only on the RHS
»»+« # same, but LHS
42, 15 »+ 1 # 43, 16
( 42, 15 ) »+ 1 # 43, 16
[ 42, 15 ] »+ 1 # 2
[ 42, 15 ] »»+ 1 # [ 43, 16 ]
The ASCII variant is a bit big, but that's okay huffmanwise, IMO.
Recursion can be a pretty big operation anyway. Being explicit about
that is good.
juerd waalboer: perl hacker <firstname.lastname@example.org> <http://juerd.nl/sig>
convolution: ict solutions and consultancy <email@example.com>
Ik vertrouw stemcomputers niet.