[erlang-patches] Add lists:init/1 - got tired of implementing it
Tue Apr 30 15:32:22 CEST 2013
I would use lists:sublist(L, 1, length(L) - 1) for this. I wouldn't
have given it a second thought.
Presumably there's a concern about performance -- why else would we
Here's a simple benchmark program that people can experiment with (or improve):
It includes the original implementation, Fred's, and what I would use (sublist).
Personally, I don't see a problem that warrants a new function in the
On Tue, Apr 30, 2013 at 5:05 AM, Siri Hansen <> wrote:
> We haven't yet made any decision regarding this patch, but we have had some
> discussions in the team and we are not totally convinced about the general
> need for this function. Thus we would appreciate some input from the list.
> So - disregarding the name and the implementation for a second - is this
> functionality a good addition to the lists module? Is it often needed?
> If so, would it be even better to do a more general version which removes
> the N last elements from the list?
> Hans, could you also possibly describe some of your use cases?
> 2013/4/29 Fredrik <>
>> On 04/25/2013 05:12 PM, Hans Svensson wrote:
>>> git fetch git://github.com/hanssv/otp.git add_init_to_lists
>> Fetched, it is currently located in the 'pu' branch.
>> A review process has started.
>> BR Fredrik Gustafsson
>> Erlang OTP Team
>> erlang-patches mailing list
> erlang-patches mailing list
More information about the erlang-patches