Front page | perl.perl6.language |
Postings from October 2006
Recursing? hypers
Thread Next
From:
Juerd
Date:
October 8, 2006 07:08
Subject:
Recursing? hypers
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.
Audrey agreed.
It would probably be useful to allow combinations of recursive and
non-recursive hypers.
»+« # 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.
--
korajn salutojn,
juerd waalboer: perl hacker <juerd@juerd.nl> <http://juerd.nl/sig>
convolution: ict solutions and consultancy <sales@convolution.nl>
Ik vertrouw stemcomputers niet.
Zie <http://www.wijvertrouwenstemcomputersniet.nl/>.
Thread Next
-
Recursing? hypers
by Juerd