audiality2 icon indicating copy to clipboard operation
audiality2 copied to clipboard

Closures

Open olofson opened this issue 12 years ago • 0 comments

The next natural level after implementing functions (see #59) would seem to be closures. That is, we somehow create an instance of a function call "in progress", storing local variables and PC, so that the function can "return" values and then be resumed later to pick up where it left off.

The tricky part is probably the actual closure. Physically, it would be somewhere in between a VM stack entry and a subvoice. A program would have to instantiate a closure somehow, and then use that (as opposed to the function itself) as a function or operator.

olofson avatar Oct 10 '13 00:10 olofson