<div dir="ltr">Hi Hans!<div><br></div><div>After many and long discussions we have now decided to re-open this patch and approve it with some comments:</div><div><br></div><div>1. we would like the name of the function to be 'droplast'.</div>
<div>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.</div><div><br></div><div>
Would you mind doing these adjustments in the patch?</div><div><br></div><div>Best Regards</div><div>/siri</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/21 Hans Svensson <span dir="ltr"><<a href="mailto:hanssv@gmail.com" target="_blank">hanssv@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Hans,<br>
I've got some feedback on your patch after review:<br>
We have decided to reject this patch as we don't see a general need for<br>
the new function.<br>
<br>
Thanks for showing interest in contributing!<br>
<br>
--<br>
<br>
BR Fredrik Gustafsson<br>
Erlang OTP Team<br>
<br>
</blockquote>
<br></div>
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 remove_last_element.<br>
<br>
Code implementing the "init"-function:<br>
compiler<br>
v3_core:first/1<br>
v3_kernel:first/1<br>
dialyzer<br>
dialyzer_contracts:but_last/1<br>
dialyzer_gui:butlast/1<br>
hipe<br>
hipe_icode_type:butlast/1<br>
orber<br>
orber_interceptors:remove_<u></u>last_element/1<br>
<br>
Direct uses of reverse(tl(reverse(L))):<br>
sasl<br>
in systools_make:smart_guess/3<br>
wx_gen<br>
in wx_gen:erl_skip_opt2/4<br>
ssh<br>
in ssh_sftpd<br>
<br>
Any further comments on this, it is really not a "new" function it is a missing function ;-)<br>
<br>
Cheers,<br>
<br>
Hans<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
erlang-patches mailing list<br>
<a href="mailto:erlang-patches@erlang.org" target="_blank">erlang-patches@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-patches" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-patches</a><br>
</div></div></blockquote></div><br></div>