[erlang-questions] Which built-in function makes [H|T] ?
Pierre Fenoll
pierrefenoll@REDACTED
Tue Nov 14 11:04:47 CET 2017
It would be nice to have a cons function, either in the erlang or lists
module.
One usage for it I have had is as the accumulator function of
filelib:fold_dirs/5
On Tue 14 Nov 2017 at 10:55, Roger Lipscombe <roger@REDACTED> wrote:
> See this thread from earlier this year:
> http://erlang.org/pipermail/erlang-questions/2017-January/091560.html
>
> On 14 November 2017 at 08:50, Richard Carlsson
> <carlsson.richard@REDACTED> wrote:
> > 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.
> >
> >
> >
> >
> > /Richard
> >
> > 2017-11-14 8:56 GMT+01:00 Zhongzheng Liu <liuzhongzheng2012@REDACTED>:
> >>
> >> Hi mail-list:
> >>
> >> Which built-in function work as fun(H, T) -> [H|T] end ?
> >>
> >> i.e how to fill the following expression without user defined function ?
> >>
> >> [H|T] = erlang:apply(???, ???, [H, T]).
> >>
> >>
> >> Thanks
> >>
> >> Liu zhongzheng
> >> _______________________________________________
> >> erlang-questions mailing list
> >> erlang-questions@REDACTED
> >> http://erlang.org/mailman/listinfo/erlang-questions
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
--
Cheers,
--
Pierre Fenoll
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171114/c46e0281/attachment.htm>
More information about the erlang-questions
mailing list