4 ms·
Tcl can do wonders in this area. uplevel is in some way more powerful than Lisp macros, since it happens at runtime.
by antirez 9y ago
Tcl can do wonders in this area. uplevel is in some way more powerful than Lisp macros, since it happens at runtime.
- ken 9y agoIsn't "uplevel" essentially Tcl's way to choose dynamic scope? Lisp has ways to do that, too.
- antirez 9y agoIt's more like "eval" in the stack frame you select. This added to the fact Tcl, like Lisp, has the same form for all the commands, allow to do anything you could conceive and it will look like if it's part of the language. For instance you can do a looping construct that works in a different way depending on the calling function name or state or any other crazy stuff like that.
- kazinator 9y agoUplevel and its ilk is related to the Lisp FEXPR and NLAMBDA mechanisms. Mainstream Lisp discarded these things decades ago; they didn't surive into ANSI standardization.