If a TyMod isn't doing lookup (i.e mod.foo), then it's fields may point to a function (asNow isTy -> &Ty). This is executed to get the type in a type context, or to get the type to compile in the compiler context!
syn methods: they are passed (var: &Var, asNow). If var is null, then it's a reference access (just get TyDb_top). They can then compile correct behavior (i.e. a local Arr type can modify local values).
Therefore you can do var a: Arr[S, 20]; a.init {1, 2, 3}
Generic methods: methods for the appropriate SIZES are generated as sub-types for the type, i.e. Bst._Bst[20]. The actual dictionary entries and typespecs are created correctly, i.e. Bst.Bst[MyStruct] (the key must be aliased and is not directly accessible)
Uses TyMod
mod.foo
), then it'sfields
may point to a function (asNow isTy -> &Ty). This is executed to get the type in a type context, or to get the type to compile in the compiler context!syn methods: they are passed (var: &Var, asNow). If var is null, then it's a reference access (just get TyDb_top). They can then compile correct behavior (i.e. a local Arr type can modify local values).
var a: Arr[S, 20]; a.init {1, 2, 3}
Generic methods: methods for the appropriate SIZES are generated as sub-types for the type, i.e. Bst._Bst[20]. The actual dictionary entries and typespecs are created correctly, i.e. Bst.Bst[MyStruct] (the key must be aliased and is not directly accessible)