2005/11/18, Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>:
> Larry Wall <[EMAIL PROTECTED]> wrote:
> > The name is relatively unimportant in the overall scheme of things.
> > I'm more worried about the fact that it's difficult to partition a
> > list into multiple lists in one pass without declaring temp arrays.
>
> Didn't the list agree long ago on a `part` builtin? I certainly wrote
> List::Part based on that discussion...
In E06:
($cats, $chattels) = part &is_feline, @animals;
How about a "switch" syntax instead?
part @animals {
when .is_feline() { @cats }
default { @chattels }
}
In the more general case:
part @a {
when $_ < 10 { @a }
when $_ < 20 { @b }
when $_ < 30 { @c }
@d
};
and:
@a.part:{
when $_ < 10 { @a }
when $_ < 20 { @b }
when $_ < 30 { @c }
@d
};
- Flavio S. Glock