<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Shouldn't be called liat/1 instead? Just joking.<br></div><div><br></div><div>Robert<br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Siri Hansen" <erlangsiri@gmail.com><br><b>To: </b>"Hans Svensson" <hanssv@gmail.com><br><b>Cc: </b>"erlang-patches" <erlang-patches@erlang.org><br><b>Sent: </b>Thursday, 16 January, 2014 11:26:02 AM<br><b>Subject: </b>Re: [erlang-patches] Add lists:init/1 - got tired of implementing it<br><div><br></div><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><div><br></div><div class="gmail_quote">2013/5/21 Hans Svensson <span dir="ltr"><<a href="mailto:hanssv@gmail.com" target="_blank" data-mce-href="mailto:hanssv@gmail.com">hanssv@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-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" data-mce-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_<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>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> ______________________________<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>_________________<br> erlang-patches mailing list<br> <a href="mailto:erlang-patches@erlang.org" target="_blank" data-mce-href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a><br> <a href="http://erlang.org/mailman/listinfo/erlang-patches" target="_blank" data-mce-href="http://erlang.org/mailman/listinfo/erlang-patches">http://erlang.org/mailman/<span style="text-decoration: underline;" data-mce-style="text-decoration: underline;"></span>listinfo/erlang-patches</a><br></div></div></blockquote></div><br></div><br>_______________________________________________<br>erlang-patches mailing list<br>erlang-patches@erlang.org<br>http://erlang.org/mailman/listinfo/erlang-patches<br></blockquote><div><br></div></div></body></html>