LinqLover / SimulationStudio

A growing suite of applications and tools using code simulation in Squeak/Smalltalk
9 stars 1 forks source link

Add support for coroutines #51

Open LinqLover opened 2 years ago

LinqLover commented 2 years ago

Example:

(Simulator evaluate: [Generator on: [:s | s nextPutAll: #(1 2 3)]]) next.

This currently raises a Computation has been terminated! from this stack:

image

The VM refuses to execute the simulation context. One approach would be to override swapSender: and continue the execution in the simulator when a simulation context is inserted. However, it might be hard to detect all possible context manipulations and execute not more than a reasonable part of the stack in the simulator.