[erlang-patches] Add lists:init/1 - got tired of implementing it
Sun Jan 19 20:25:33 CET 2014
Separate patch with separate commits one for each application, please.
On Sun, Jan 19, 2014 at 7:15 PM, Hans Svensson <> wrote:
> Great! I'll fix that! I happened to re-implement this function again the
> other day, and thought about how sad it was that the function wasn't there
> Would you like me to actually use the function (in the places mentioned
> below) as well, our would you prefer that to be a separate patch?
> On 2014-01-16 11:26, Siri Hansen wrote:
>> Hi Hans!
>> After many and long discussions we have now decided to re-open this
>> patch and approve it with some comments:
>> 1. we would like the name of the function to be 'droplast'.
>> 2. we want the simple recursive implementation with no special handling
>> of bad arguments, i.e. we think it is ok with a function_clause error
>> for arguments that are not non-empty proper lists.
>> Would you mind doing these adjustments in the patch?
>> Best Regards
>> 2013/5/21 Hans Svensson < <mailto:>>
>> Hello Hans,
>> I've got some feedback on your patch after review:
>> We have decided to reject this patch as we don't see a general
>> need for
>> the new function.
>> Thanks for showing interest in contributing!
>> BR Fredrik Gustafsson
>> Erlang OTP Team
>> That is sad news, and we find it a bit strange since *you* (as in
>> the OTP team) yourself seems use this particular function/pattern
>> quite frequently. We did a quick search through the OTP code base
>> and found quite a few places where this particular function is
>> either implemented recursively and used, or just uses
>> reverse(tl(reverse(List)))). Also interesting to see is the
>> different names used: first, butlast, but_last and
>> Code implementing the "init"-function:
>> Direct uses of reverse(tl(reverse(L))):
>> in systools_make:smart_guess/3
>> in wx_gen:erl_skip_opt2/4
>> in ssh_sftpd
>> Any further comments on this, it is really not a "new" function it
>> is a missing function ;-)
>> erlang-patches mailing list
> erlang-patches mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-patches