3 ms·
> If you squint it almost looks like exception handling! It also reminds me of TCL's "uplevel": https://www.tcl.tk/man/tcl8.4/TclCmd/uplevel.html https://www.t
by dllthomas 5y ago
> If you squint it almost looks like exception handling!
It also reminds me of TCL's "uplevel": https://www.tcl.tk/man/tcl8.4/TclCmd/uplevel.html https://www.tcl.tk/man/tcl8.4/TclCmd/uplevel.html
- cryptonector 5y agoBash does kinda have something like uplevel, and I use it: `typeset -n`.
- dllthomas 5y agoThat's more pass-by-reference, right? Which can be used to set things in the calling context, to be sure, but seems meaningfully different from "run this code N frames up", partly because it is limited in what it can do and partly because it can only change variables that you are actually mentioning in what you pass in. (... unless I miss something.)
- cryptonector 5y agoNo, it's pass-by-name, which can feel like pass-by-reference. And yes, it's only that.
- dllthomas 5y agoI usually associate "call-by-name" with laziness. Isn't this more pass-by-reference that may happen to be implemented using names under the hood? Alternatively, how would you distinguish them?