[erlang-questions] What does it mean when an evaluated expression is a list that contains the pipe character?

Gordon Guthrie gguthrie@REDACTED
Tue Feb 24 16:53:21 CET 2015


C

In case you are uncertain as to what that means - here is a wee primer:

http://stackoverflow.com/questions/1919097/functional-programming-what-is-an-improper-list <http://stackoverflow.com/questions/1919097/functional-programming-what-is-an-improper-list>

G

> Le 24 févr. 2015 à 15:37, Cole Fichter <cole.fichter@REDACTED> a écrit :
> 
> I came across the example:
> 
> > [1,2|3].
> [1,2|3]
> 
> I understand that the pipe character, |, can be used to append an item to the head of the list or to pop an item off the list in a pattern match.
> 
> But what exactly is happening in the example above? Why does the evaluated expression still contain the pipe?
> 
> My best guess is that the final expression results in a match specification that could be used in a pattern match. However, that seems strange too because if so, we'd be popping two items off the list, which should be illegal.
> 
> Can someone shed some light?
> 
> Thanks!
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150224/55985d49/attachment.htm>


More information about the erlang-questions mailing list