interface SExpr imports Symbol END; (* @@does ILU have subtyping rules? it should be the case that SExpr.T <: Refany.T if not in ISL, then in the implementation languages *) TYPE T = OPTIONAL Cell; TYPE Cell = UNION pair: Pair, symbol: Symbol.T, int: INTEGER, (* #@float/rat/real? *) string: String, (* #@intseq, stringseq? *) table: Table END; TYPE String = ilu.CString; TYPE Pair = OBJECT BRAND "Pair 1.0" METHODS FUNCTIONAL first(): T, FUNCTIONAL rest(): T End; (* table allows natural marshalling of: perl associative arrays scheme hash tables python dictionarys postscript dictionaries SmallTalk dictionaries *) TYPE Table = SEQUENCE OF Pair; (*@@@@@@@@@@2 INTERFACE SExpr; TYPE Cons = RECORD car : T, cdr : T END; TYPE Node = COLLECTABLE OBJECT METHODS FUNCTIONAL (*???*) first(): T; FUNCTIONAL (*???*) rest(): T; END; TYPE Symbol = ilu.CString; (* hmm... package? some kind of tag? *) TYPE Cell = UNION node : Node, cons : Cons, symbol : Symbol, string : ilu.CString, int : INTEGER END; TYPE T = OPTIONAL Cell; *)