On Tue, Sep 19, 2006 at 07:56:44PM -0400, [EMAIL PROTECTED] wrote: > I envision a select, reject, and partition, where > > @a.partition($foo) > > Returns the logical equivalent of > > [EMAIL PROTECTED]($foo), @a.select($foo)] > > But only executes $foo once per item. In fact. I'd expect partition > to be the base op and select and reject to be defined as > partition()[1] and partition()[0] respectively...
Hmm, that has appeal. If you assign a partition to a list of arrays, 0/false selected go into the first, number goes into the n'th, with the last also getting numbers that are too big and strings that are true. But it could instead be assigned to pairs, and the partition block selects a key or default which chooses the target. --