[erlang-questions] List to proplist?

Hans Bolinder hans.bolinder@REDACTED
Wed Oct 29 13:15:54 CET 2008


[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.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson



More information about the erlang-questions mailing list