[Nickle]Recursive datatypes (was: Tonight's topics)
Carl Worth
nickle@nickle.org
Wed, 24 Jul 2002 13:27:19 +0000
On Jul 24, Bart Massey wrote:
> 3) There should be no way to create a type with no obviously
> well-defined values.
Agreed.
> In the absence of partial <undef>
> this means that
> typedef x;
> typedef struct {
> x y;
> } x;
> has to go, and also its singly and mutually recursive
> cousins. I sincerely doubt anyone will miss them.
While I could probably live without this, what's the fundamental
difference between that struct definition and the following:
typedef struct {
poly y;
} x;
where I can still assign y a value of type x? It seems the first
definition would actually be better for this purpose as it provides
type checking.
Maybe the difference is that there is a defined "zero of type poly"
but no "zero of type structured value"? If so, might it make sense to
create a new zero?
-Carl
--
Carl Worth
USC Information Sciences Institute cworth@east.isi.edu
3811 N. Fairfax Dr. #200, Arlington VA 22203 703-812-3725