[erlang-questions] Additions to lists module

Dave Smith <>
Thu Nov 27 00:17:36 CET 2008


2008/11/26 Mazen Harake <>

> What is the idea behind pos?
>
> Curious because I have never been in a situation where I need to know
> the actual position of an element since I always assume that the order
> in a list is always undefined. Perhaps I missed something... do you have
> a practical example?
>
> /M
>
>
I'm not following. Lists are ordered and in many cases order is meaningful.
Otherwise you would never have reason to reverse a list.

There are many functions in the lists module where the result is dependant
on the lists order, and there is precedence for functions like foldlwhile;
examples (takewhile/2, dropwhile/2, splitwith/2)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081126/f7a14842/attachment.html>


More information about the erlang-questions mailing list