4 ms·
Will commence working on a doc to explain some design choices, and what some non-obvious code fragments do; will update here when I commit. There's no subtyping
by wycliffb 8y ago
Will commence working on a doc to explain some design choices, and what some non-obvious code fragments do; will update here when I commit.
There's no subtyping being done currently.
The 'match type' construct matches the type of an expression at compile time.
I should also add that some design choices may be reviewed before the first release.
- dan-robertson 8y agoSurely if match type is compile time and there is no subtyping then it is basically a no-op type assert. I.e. it’s like writing (e : t) in ML? Or is it supposed to allow for some kind of ad-hoc polymorphism like: func foo(x) string { match type(x) { char** : return “an array of strings” int : return “a number” default : return “not sure” } } And this gets transformed into something like: func foo(Type x_t, x_t x) string { match(x_t) { pointer_t(pointer_t(char_t)) : return ... ... } }
- wycliffb 8y agoInteresting suggestion! Will be sure to add that when I can.