Improper lists [was: Dialyzer v1.3.0 released]

James Hague james.hague@REDACTED
Mon Mar 28 16:28:34 CEST 2005


>  > In theory you could have a special type tag for "two element tuple"
> 
> Apart from not being a tuple, isn't that exactly what a cons cell is?!

Yes, of course.  But "not being a tuple" is what matters :)  You have
two ways of representing a pair:

{a,b}
[a|b]

But is [a|b], when used to store two arbitrary values, an efficiency
hack or simply taking full advantage of cons cells?  Certainly {a,b}
is more, uh, "Erlangian."

James



More information about the erlang-questions mailing list