[erlang-questions] List to proplist?
Hynek Vychodil
vychodil.hynek@REDACTED
Wed Oct 29 14:42:03 CET 2008
On Wed, Oct 29, 2008 at 2:29 PM, Martin Bjorklund <mbj@REDACTED> wrote:
> Richard Carlsson <richardc@REDACTED> wrote:
> > Hans Bolinder wrote:
> > > [Richard O'Keefe:]
> > >> A version of unfold that I prefer is
> > >>
> > >> unfold(State, Splitter) ->
> > >> unfold(State, Splitter, []).
> > >>
> > >> unfold(State, Splitter, Acc) ->
> > >> case Splitter(State)
> > >> of [] -> lists:reverse(Acc)
> > >> ; [Item|State1] -> unfold(State1, Splitter, [Item|Acc])
> > >> end.
> > >
> > > Thanks!
> > >
> > > lists:unfold/2 has been added to the upcoming R12B-5 release.
> >
> > I was going to comment on this before, but didn't get around to it.
> > Please don't use the return convention above; it is not normal
> > Erlang programming style, and introduces an improper list for no
> > really good reason.
>
> +1. I was just going to make the same comment.
>
+1. me too
>
>
> /martin
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
--
--Hynek (Pichi) Vychodil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081029/e0b679fd/attachment.htm>
More information about the erlang-questions
mailing list