Improper lists [was: Dialyzer v1.3.0 released]

Carsten Schultz carsten@REDACTED
Mon Mar 28 19:47:48 CEST 2005


Hi!

On Mon, Mar 28, 2005 at 08:28:34AM -0600, James Hague wrote:
> >  > 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."

Some of the messages were like

    Cons will produce a non-proper list since its 2nd arg is 
    (() -> possibly_improper_list())!

This looks to me like a lazy list, so I can understand that [ | ] is
used.

Carsten

-- 
Carsten Schultz (2:38, 33:47)
http://carsten.codimi.de/
PGP/GPG key on the pgp.net key servers, 
fingerprint on my home page.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050328/b7988dd2/attachment.bin>


More information about the erlang-questions mailing list