[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] coops

From: Thomas Chust
Subject: Re: [Chicken-users] coops
Date: Wed, 19 Jan 2011 16:01:11 +0100

2011/1/19  <address@hidden>:
> [...]
> Then all pairs are lists? What about (cons 1 2)? I thought a list is a pair
> which cdr is a list (or the empty list -- exclude that case for a moment).
> [...]

Hello Sandro,

you're right, I neglected the case of pairs whose cdr is not a
list. So to be precise, the type hierarchy actually looks like this
(where A --> B means that B is a subtype of A):

  some value --+--> pair --+--> degenerate list (cdr is not a list)
               |           |
               |           +--> non-empty list (cdr is a list)
               |           |
               \--> list --+--> empty list

This means that neither pair nor list is a supertype of the other, but
the types are not disjuct, their intersection being exactly the type
of non-empty lists.

However, this fairly complex type hierarchy is apparently not what's
modelled by coops. Maybe it should be.


When C++ is your hammer, every problem looks like your thumb.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]