Matthias Felleisen writes: > I guess the real problem is to create suitable default values so > that the pass the type checker or to figure out a cast that forces > TR to accept some other value as the default value (and making sure > you never use the object). > > Undefined not completely solved. Argh. -- Matthias
A related issue is the requirement to make data structures mutable in order to allow cyclic data. That's a lot of risk to take for a one-time use. Could single-assignment cells be part of a solution to both issues? Instead of mutable cells in a struct (or list ...) , one would have single-assignment cells. They are initialized to undefined, and assignment is only allowed from undefined to some other value, which means it can happen only once. A special code block (Racket's share) would allow the creation and initialization and guarantee that everything is fully initialized in the end, meaning that the type checker doesn't have to worry about possible undefined values in the rest of the code. A variant on this idea is Clojure's transients: data structures that are created mutable, but are locked explicitly after initialization to become immutable. That's much more general, but probably also much harder to trace by a type checker. Konrad. ____________________ Racket Users list: http://lists.racket-lang.org/users

