[erlang-questions] List to proplist?

Ulf Wiger ulf@REDACTED
Mon Nov 3 17:10:03 CET 2008


Perhaps we should also clarify exactly what warrants an EEP and what
doesn't. In the case of mnesia:read/2, an EEP was apparently overkill,
but in this case it isn't?

BR,
Ulf W

2008/11/3, Hans Bolinder <hans.bolinder@REDACTED>:
> [Richard Carlsson:]
>> 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.
>>
>> 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. A more traditional return convention would
>> use e.g., {Item,State1} | 'none'.
>
> [I answered:]
>> Thank you for your comments. We have, however, decided not to modify
>> the code provided by Richard O'Keefe.
>
> After some more afterthought, we've decided to withdraw lists:unfold/2
> from R12B-5. We feel that it was introduced a bit hastily, and that
> the normal procedure for introducing new functionality in Erlang and
> supporting libraries should be followed. Therefore an EEP will be
> written, giving plenty of time before R13B to collect further comments
> and suggestions.
>
> Best regards,
>
> Hans Bolinder, Erlang/OTP team, Ericsson
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list