Difference between revision 2 and current revision
No diff available.
oot control design todos
do we support ruby-like blocks inside of which a 'return' returns from the caller? if so, how; can every function be called in this way (without making a new stack frame, i guess), or are they declared differently when they are defined?
if everything is not an object, like in Ruby and Io, then how do we make sure that calls can always be prettily chained together?
---
Control structures
Core:
goto LABEL (labels can be quoted and are first-class, so this gives us computed-goto also)
if (really a 'switch' has an else; no fallthru; if head expression is omitted, assumed to be TRUE, meaning that the switch cases are a more convenient way to write if/then/elsif/elsif/.../else) (notations for parallel ('all') or not ('sequential') when multiple matches; ordinary 'if' is recovered when the head expression is omitted and there is only one case)
for (foreach) (this is core b/c it is parallel by default, in which case it can be executed as SIMD)
todo: concurrency stuff? something like fork?
emit (unification of send, return, yield, throw; options for what message (object) to emit, whether to terminate execution, or if not whether to block on handling the emitted message or to continue immediately)
and receive/catch (mb just call this "on" as in onMouseDown)
first-class call stack
Other:
while
whilst (repeat..until except with the condition at the beginning)
break (optional LABEL of loop to break out of)
continue (optional LABEL of loop to continue in)
assert, try, except/catch, finally, raise/throw, defer, resume (these are mostly subtypes of the nonlocal emit/on stuff which carries the semantics of a contract being broken)
call, tailcall (uses goto in conjunction with call stack manipulation and entering scopes)
return (also encompasses alternate returns, somehow; mb with receives on the other end?)