Modules -- representation hiding
typedef int element; enum { NIL, CONS }; struct list { int tag; element e; list* next; };
Generators
list* nil() {list* l = new list; l->tag = NIL; return l; } list* cons( element e, list* l) {
nil list* x = new list; x->tag = CONS; x->e = e; x->next = l; return x; }
cons