[erlang-questions] Weird lists:dropwhile/2 behavior?

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Sun Feb 21 14:36:05 CET 2016


On Sun, Feb 21, 2016 at 1:39 PM, fxmy wang <fxmywc@REDACTED> wrote:

> Is this behavior expected?


yes. To make it explicit:

In lists:dropwhile(fun(E) -> E > 3 end, [1,2,3,4,5]), we first check if 1 >
3. This is false, so we stop dropping and return the remainder of the list,
which is [1,2,3,4,5].


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160221/29807026/attachment.htm>


More information about the erlang-questions mailing list