<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 14 Nov 2017, at 09:50, Richard Carlsson <<a href="mailto:carlsson.richard@gmail.com" class="">carlsson.richard@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Most operators have a corresponding function in the 'erlang' module. For example, A + B can be written erlang:'+'(A,B). However, the cons operator [|] does not, as far as I know.</div></div></blockquote><div><br class=""></div><div>I’ve always considered this a gross oversight for several reasons.  One is that you have to write your own local fun when you want to pass it as higher order functional argument, another is that should one generate Erlang code directly one has to take care of this and generate special syntax.  Then there is the personal obvious reason :-)</div><div><br class=""></div><div>Cons</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><br class="">        /Richard</div></div>
<br class=""><div class="gmail_quote">2017-11-14 8:56 GMT+01:00 Zhongzheng Liu <span dir="ltr" class=""><<a href="mailto:liuzhongzheng2012@gmail.com" target="_blank" class="">liuzhongzheng2012@gmail.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi mail-list:<br class="">
<br class="">
Which built-in function work as   fun(H, T) -> [H|T] end ?<br class="">
<br class="">
i.e how to fill the following expression without user defined function ?<br class="">
<br class="">
[H|T] = erlang:apply(???, ???, [H, T]).<br class="">
<br class="">
<br class="">
Thanks<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
                           Liu zhongzheng<br class="">
______________________________<wbr class="">_________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank" class="">http://erlang.org/mailman/<wbr class="">listinfo/erlang-questions</a><br class="">
</font></span></blockquote></div><br class=""></div>
_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""></body></html>