Sujet : A suggestion for Tcl 9 De : hgiese (at) *nospam* ratiosoft.com (Helmut Giese) Groupes :comp.lang.tcl Date : 05. Nov 2024, 23:24:53 Autres entêtes Organisation : ratiosoft Message-ID :<ka5lij9qa7jem9e2ina4ndndhot2ju40qh@4ax.com> User-Agent : Forte Free Agent 1.93/32.576 English (American)
Hello out there, currently Tk accepts only _gobal_ variables for widgets which set a value. I always wondered why it doesn't also accept a fully namespaced variable, too. Like so: --- namespace eval ns { variable someVar "" } ttk::radiobutton .rad -text "Some text" -variable ::ns::someVar --- If one demanded that always either a global or a _fully namespaced_ variable had to be supplied it would not cause any ambiguities even when the above call would have been inside the namespace where the variable 'someVar' already is defined. Tcl 9 is the opportunity to introduce incompatibilities - although I wonder if this even IS an incompatibility: In Tcl 8 a syntax like -var ::ns::someVar is not illegal: it just doesn't have any effect while in Tcl 9 it would. But this is probably a question of language semantics which I am not qualified to judge. Comments welcome Helmut