[nem-en] extra list operations

Michal Moskal michal.moskal at gmail.com
Sat Dec 30 10:10:22 CET 2006


On 12/30/06, Ivan Lakhturov <lakhturov at gmail.com> wrote:
> Hello devel-en,
>
>   a dude from rsdn asked to add
>
> public IterRest[T](lst: list[T], f: T * list[T] -> void): void
> {
>     match(lst)
>     {
>         | x :: xs => f(x, xs); IterRest(xs, f)
>         | _ => ()
>     }
> }
>
>     to nemerle library (lists.n)
>
>     is this operation seemed useful?
>
>     he'd also like to see in lists the following operations:
>
>     FoldRest
>     IndexOf

Makes sense to me. LastIndexOf could be also useful.

I just wonder, maybe we should also have a version of IndexOf taking
predicate and not an object? I'm not sure if it would be better to
overload IndexOf, or introduce another name.

-- 
   Michał


More information about the devel-en mailing list