> A generic list of immutable objects

cons T {
  readonly T *car;
  cons T *cdr
};

> An immutable generic list of mutable objects

cons T {
  T *readonly car;
  cons T *readonly cdr
};

The reference to the head of the list would have to be declared readonly.

> An appendable generic list of mutable (or immutable) objects

An appendable list of deep immutable objects (sort of).

appendable T {
  cons T *deep readonly list,
  cons T *tail
};

cons T {
  T *deep readonly car,
  cons T *cdr
};

So long as our references to appendable are shallow readonly then we
can append to our hears content however we can also remove elements
that have been appended so not quite what you're asking for but the
best I can come up with for now.
_______________________________________________
bitc-dev mailing list
bitc-dev@coyotos.org
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to