[1,[2|3]] vs [1,2|3]

Roger Price rprice@REDACTED
Sat Apr 29 16:20:43 CEST 2006


Dear List,

The Erlang (BEAM) emulator version 5.4.9 [source] [hipe] with 
Eshell V5.4.9 reports:

1> [1,[2|3]] .          %% Valid list
[1,[2|3]]                        
2> [1,2|3] .            %% Not a list
[1,2|3]

My understanding is that [1,[2|3]] = 1::[2|3]::nil = 1::(2::3)::nil
                     and [1,2|3]   = 1::2::3
using the ML infix notation.

Is this correct?
Thanks,
Roger



More information about the erlang-questions mailing list