[erlang-questions] Irregular list

Zvi <>
Thu Feb 12 17:43:53 CET 2009


technicaly [a|b] is not a proper list, it's what called in LISP a "cons-cell"
(a . b) in proper list cdr (i.e. tail) field of last element must be nil (or
[] ) in Erlang.


Ladvánszky Károly-2 wrote:
> 
> Just getting acquainted with this wonderful system, I’ve run into the
> following issue:
> 
>  
> 
> The shell seems to accept a structure like this: [a | b].
> 
>  
> 
> is_list([a | b]) returns true but length([a | b]) raises an exception.
> 
>  
> 
> Is it like an “open list” found in some programming languages?
> 
>  
> 
>  
> 
>  
> 
> Any help would be appreciated,
> 
>  
> 
> LKaroly
> 
>  
> 
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
> 

-- 
View this message in context: http://www.nabble.com/Irregular-list-tp21977982p21979837.html
Sent from the Erlang Questions mailing list archive at Nabble.com.




More information about the erlang-questions mailing list