Open zot opened 11 years ago
destructor functions can take a nested structure and return a list of values in order
structures are
struct(type partsList) var lit(value)
the structure for f x::[a [b c] | d] would be: struct('cons' [var struct('cons' [struct('cons' [var struct('cons' var lit(nil))]) var])]
the structure for f x::(person name addr) would be struct('person' [var var])
structures could be type[ ... ] or (type ...), with [] standing for just a cons
Patterns could work in lets, as well
Type assertions work, but more general patterns would be nice. This is a decent way to allow extending definitions.