<div dir="ltr">It is easy to define:<div><br></div><div>cons(H,T) -> [H|T].</div><div><br></div><div>but you are perhaps better off by just using a fun-wrapper or writing it directly in places where you need it. Without support for currying much of the higher-order vocabulary seems somewhat weaker.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 31, 2017 at 7:26 PM Richard Carlsson <<a href="mailto:carlsson.richard@gmail.com">carlsson.richard@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">No, it's considered a language primitive, similar to fixed-size tuples {1,2}. That's not to say that there couldn't be a named function like the one you looked for, just that there isn't one because there has never been much of a need for it.<div class="gmail_extra gmail_msg"></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_msg"><div class="m_-376384073381475143gmail_signature gmail_msg" data-smartmail="gmail_signature"><br class="gmail_msg"> /Richard</div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg">
<br class="gmail_msg"><div class="gmail_quote gmail_msg">2017-01-31 16:16 GMT+01:00 Garrett Smith <span dir="ltr" class="gmail_msg"><<a href="mailto:g@rre.tt" class="gmail_msg" target="_blank">g@rre.tt</a>></span>:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a functional reference to the cons operator? Something<br class="gmail_msg">
equivalent to this:<br class="gmail_msg">
<br class="gmail_msg">
fun(H, T) -> [H|T] end<br class="gmail_msg">
<br class="gmail_msg">
I was hoping for erlang:'|'(H, T) but no dice.<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
erlang-questions mailing list<br class="gmail_msg">
<a href="mailto:erlang-questions@erlang.org" class="gmail_msg" target="_blank">erlang-questions@erlang.org</a><br class="gmail_msg">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" class="gmail_msg" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="gmail_msg">
</blockquote></div><br class="gmail_msg"></div></div>
_______________________________________________<br class="gmail_msg">
erlang-questions mailing list<br class="gmail_msg">
<a href="mailto:erlang-questions@erlang.org" class="gmail_msg" target="_blank">erlang-questions@erlang.org</a><br class="gmail_msg">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" class="gmail_msg" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br class="gmail_msg">
</blockquote></div>