Why is tcl broken?

Joe English jenglish at flightlab.com
Wed Jun 30 22:03:05 CEST 1999


Marco Antoniotti wrote:

>BTW. Is TCL statically or dynamically scoped?

Neither, really, since Tcl doesn't have nested procedures, lambda
expressions, "let/letrec", local bindings or the like.

I'd describe Tcl as "namespace-scoped": there is an open-ended set
of top-level "namespace" environments, plus a distinguished "global"
environment.  In addition, each Tcl "proc" has its own local environment,
into which variables from other environments can be explicitly imported
via "variable", "global", explicit namespace reference, or "upvar".
"upvar" gives you something *sort* of like dynamic scope, but not
exactly.


--Joe English

  jenglish at flightlab.com




More information about the Python-list mailing list