3 ms·
Here is an example of trampolining in a Scheme interpreter I wrote in JavaScript: https://github.com/erjiang/foxscheme/blob/master/src/system/interpreter.js#L24
by erjiang 13y ago
Here is an example of trampolining in a Scheme interpreter I wrote in JavaScript: https://github.com/erjiang/foxscheme/blob/master/src/system/interpreter.js#L241 https://github.com/erjiang/foxscheme/blob/master/src/system/...
This way, interesting Scheme programs can be written without using the small JavaScript stack.
It uses an infinite loop that's broken out of by throwing an exception. There are also some other tricks that it uses to allow other things to happen on the page while it runs your program.
- tcdowney 13y agoLooks like Friedman taught you well. :)