Hi, On Tuesday 16 March 2004 08:49, Will Coleda wrote: > On Tuesday, March 16, 2004, at 02:01 AM, Leopold Toetsch wrote: > > Well just use the global ops. > > > > global "tcl_globals" = the_hash # store > > .. > > pref = global "tcl_globals" # fetch > > [snip] > > > > Why not just use the global opcodes? > > > > leo > > Because global variables in tcl are different than global state > internal to my interpreter, and it would probably be sporting of me to > only expose the variables defined in the language, rather than those > used internally by the bytecode - so, if global opcodes are the way to > store global language variables, then I need a way to hide my private > data. You can also use another namespace: store_global "TCL::InternalData", "globals", the_hash ... find_global the_hash, "TCL::InternalData", "globals" Using special ASCII characters in the name might also avoid accidental access of "your globals".
> My initial thought had been that tcl's "global" was really more like > outermost lexical scope, so I was going to blissfully continue using > "global" for my personal junk, but the respondent seemed to think this > was not a good thing for interoperability. > > > -- > Will "Coke" Coleda will at coleda > dot com jens