<div dir="ltr">Separate patch with separate commits one for each application, please.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 19, 2014 at 7:15 PM, Hans Svensson <span dir="ltr"><<a href="mailto:hanssv@gmail.com" target="_blank">hanssv@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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 ;-)<br>
<br>
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?<br>
<br>
/Hans<div class="im"><br>
<br>
On 2014-01-16 11:26, Siri Hansen wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Hans!<br>
<br>
After many and long discussions we have now decided to re-open this<br>
patch and approve it with some comments:<br>
<br>
1. we would like the name of the function to be 'droplast'.<br>
2. we want the simple recursive implementation with no special handling<br>
of bad arguments, i.e. we think it is ok with a function_clause error<br>
for arguments that are not non-empty proper lists.<br>
<br>
Would you mind doing these adjustments in the patch?<br>
<br>
Best Regards<br>
/siri<br>
<br>
<br></div>
2013/5/21 Hans Svensson <<a href="mailto:hanssv@gmail.com" target="_blank">hanssv@gmail.com</a> <mailto:<a href="mailto:hanssv@gmail.com" target="_blank">hanssv@gmail.com</a>>><div><div class="h5"><br>
<br>
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<br>
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>
<br>
That is sad news, and we find it a bit strange since *you* (as in<br>
the OTP team) yourself seems use this particular function/pattern<br>
quite frequently. We did a quick search through the OTP code base<br>
and found quite a few places where this particular function is<br>
either implemented recursively and used, or just uses<br>
reverse(tl(reverse(List)))). Also interesting to see is the<br>
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></div></div>
orber_interceptors:remove___<u></u>last_element/1<div class="im"><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<br>
is a missing function ;-)<br>
<br>
Cheers,<br>
<br>
Hans<br>
<br></div>
______________________________<u></u>___________________<br>
erlang-patches mailing list<br>
<a href="mailto:erlang-patches@erlang.org" target="_blank">erlang-patches@erlang.org</a> <mailto:<a href="mailto:erlang-patches@erlang.org" target="_blank">erlang-patches@erlang.<u></u>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>
<<a href="http://erlang.org/mailman/listinfo/erlang-patches" target="_blank">http://erlang.org/mailman/<u></u>listinfo/erlang-patches</a>><br>
<br>
<br>
</blockquote><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>