This now type checks. It's starting to feel real... union IntOrPtr { i: int; p: int*; } var u1 = IntOrPtr{i = 42} var u2 = IntOrPtr{p = cast(int*, 42)} var a: int[256] = {1, 2, ['a'] = 3}
Putting type symbols on the left and access symbols on the left creates a symmetry between “definition by type” and “definition by example”: x:^int # x is a pointer to an int x^:int # x dereferenced is an int f:int->int f(x:int):int
-
-
left* right* This is a syntactic principle many languages partly implemented, but I’ve never seen explicitly stated or systematically implemented.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.