Sugg. for additional function in queue.erl

Chandrashekhar Mullaparthi <>
Tue Oct 31 18:18:25 CET 2000

I think this function will be a small improvement to the queue module, where
we want to create a queue from a list of integers, for example.

new(List) when list(List) -> {List, []}.

instead of writing

List = [...], % some list of items
Fun = fun(X, Q) -> queue:in(X, Q) end,
Queue = lists:foldr(Fun, queue:new(), List)


This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.

More information about the erlang-questions mailing list