Generics syntax and refs ------------------------ I think refs/non-refs should be explicit: type List = private ref List list1 ref List list2 ref List list3 #ref List list4 list1 contains references to SomeStructs list2 contains references to ints (should this be allowed?) list3 contains ints directly (where the pointer would be, but padded to the correct size) list4 is not allowed since it would not work on 32 bit platforms Optional types and generics? ---------------------------- Should it be allowed? Where should the "none" be allowed? (We only have one "none" value) - either in the paramter, or in the definitions, e.g: # ---- Either this: ---- type Entry = struct { ref? T thing } func get_thing(ref Entry entry) -> ref? T ref Entry entry = ... # "none" if absent. # a "none" value cannot be placed in "entry". ref? Something st = entry.get_thing(entry) # ---- OR this: ---- ref Entry entry = ... # none if a "none" value was put into the Entry, # never none otherwise. ref? Something st = entry.get_thing(entry) Special solution for optional values ------------------------------------ Allow several levels of none values using low values (like 0...255) This has a performance impact, though, because taking the "value" of an optional type requires a check whether it is less than 255, and if so, an decrement operation. An alternate solution is to always decrement! This breaks conservative garbage collectors (and makes debugging etc. a bit harder), but otherwise it is a very simple solution. Even comparisons between none values should work, because two data items can only be compared if they have compatible types (= same base type + same number of nested optional types) (But on the other hand, comparisons of raw optional values is more likely to be unintentional than not.) But the simplest option is of course to simply forbid nested optional types.