4 ms·
> I'm not entirely convinced of which way to add dynamic scoping to scheme is best I believe the way Kernel[1,2,3] handle this is really great. A `vau` express
by p4bl0 15y ago
> I'm not entirely convinced of which way to add dynamic scoping to scheme is best
I believe the way Kernel[1,2,3] handle this is really great. A `vau` expression is like a `lambda` expression (it's a lexically scoped fexpr actually) except that its operands (~ arguments) are passed in call-by-text and there is an extra argument which is the dynamic environment of the call site. This way you can `eval` the operands in the dynamic environment if you want to, but you can also `eval` quoted symbols or expressions in this same environment, thus achieving dynamic scoping.
This is very powerful, `vau` expressions can replace functions and macros altogether (and you have first class macros "for free" for instance). The counterpart is that I don't know if this kind of code can be compiled down to efficient code.
[1] http://web.cs.wpi.edu/~jshutt/kernel.html http://web.cs.wpi.edu/~jshutt/kernel.html - John N. Shutt's Kernel page.
[2] http://klisp.org/ http://klisp.org/ - An implementation of Kernel.
[3] http://axisofeval.blogspot.fr/ http://axisofeval.blogspot.fr/ - a blog which talks a lot about Kernel.
- dfox 15y agothis is mostly orthogonal to issue I have. Syntax-wise I want either Common Lisp or IsLisp style special variables, with selection of syntax being predicated on other concerns like performance, interaction with multiple threads (dfsch was originally fully multithreaded, current implementation uses global interpreter lock only for few rare operations, which is faster than fine-grained locking) and isolation between multiple lexical environments (so dynamic variables have to be partially lexicaly scoped)