Open
Description
Currently, let fn
s are only in scope after the statement, so they cannot be recursive. Instead, it should be that, all let fn
s in a consecutive sequence of let fn
statements are in scope from the first such statement.
For example, in the following code:
/* 1 */ let x = ...;
/* 2 */
/* 3 */ let fn foo(...) { ... }
/* 4 */ let fn bar(...) { ... }
/* 5 */ let fn baz(...) { ... }
/* 6 */
/* 7 */ let y = ...;
/* 8 */
/* 9 */ let fn qux(...) { ... }
foo
, bar
, and baz
would be in scope for lines 3 onward, and qux
would be in scope for lines 9 onward.
This would make let fn
s arguably the most primitive form of control flow in Vine; they correspond nearly 1-to-1 to transfers in the SFG.