Hacker News new | ask | show | jobs
by tempodox 444 days ago
Does Tcl have lexical scoping yet? If not, I'd have to disagree that it would have been a better language. JS is not one of the better languages I know, but it does have lambdas and lexical scoping. And as bad as JS's type system may be, at least it's not stringly-typed.
1 comments

Allow me to introduce you to upvar https://www.tcl-lang.org/man/tcl9.0/TclCmd/upvar.html and its uplevel friend https://www.tcl-lang.org/man/tcl9.0/TclCmd/uplevel.html

I cannot possibly imagine the horrors of frontend frameworks that can grab values, or execute, in someone else's context willy nilly

Exactly, it's dynamic scoping. As far as I know, Tcl is the only language that still has this skeleton in its closet.
With great power comes great responsibility :-)