Re: Add lists:init/1 - got tired of implementing it
Samuel <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.patches |
|---|---|
| Message-ID | <CAH2nEUhs6K0KHDxt4=co9VdzQ9nQR+XxCww9qwNJeRe0fvCE6A@mail.gmail.com> |
If I understand correctly, the reason to add this function is not performance. So the discussion about whether to add it or not should verse around whether it makes sense to have that functionality in the standard library. Once decided it makes sense, then the discussion about performance is relevant, but not before. Also, when discussing whether this function is useful or not, I don't find particularly constructive talking about higher level use cases than plainly "getting the last N elements of a list". lists is a very generic purpose library, we cannot play the game here of assessing all possible uses of it. Programs may be using lists efficiently but have an infrequent corner use where it is ok to access them inefficiently instead of complicating the whole implementation, or maybe is a prototype, or maybe is useful while debugging in the shell, etc. For me the important questions, once knowing that at least someone has a need for this, are: * Is it generic or couples lists with external application logic? * Does it clutter the api? * Does it make sense along with other functions in the api? * Does it encourage any particularly dangerous use pattern? IMO, the proposed function with two arguments passes that filter, but I cannot judge whether the effort of implementing and maintaining it pays off for OTP. _______________________________________________ erlang-patches mailing list [email protected] http://erlang.org/mailman/listinfo/erlang-patches