(no title)
sparkie | 9 days ago
puts("foo");
defer { puts("bar"); }
puts("baz");
defer { puts("qux"); }
puts("corge");
return;
Will evaluate: puts("foo");
puts("baz");
puts("corge");
puts("qux");
puts("bar");
return;
vlowther|9 days ago
sparkie|9 days ago
`defer` is obviously not implemented in this way, it will re-order the code to flow top-to-bottom and have fewer branches, but the control flow is effectively the same thing.
In theory a compiler could implement `comefrom` by re-ordering the basic blocks like `defer` does, so that the actual runtime evaluation of code is still top-to-bottom.