Artifacts Associated With Ticket 218414
Ticket change [2ca0eeaa15] (rid 118936) by nobody on 2000-10-26 00:57:17:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 5492 RFE Version: 8.2.1 SubmitDate: '2000-05-15' LastModified: '2000-05-15' Severity: LOW Status: Closed Submitter: techsupp ChangedBy: hobbs OS: Solaris OSVersion: 2.6 Machine: sun4u FixedDate: '2000-10-25' ClosedDate: '2000-05-15' Name: Benjamin Vitale DesiredBehavior: In Tcl_VwaitObcCmd, you call Tcl_TraceVar with the TCL_GLOBAL_ONLY flag. I just ran up against the same problem as in bug id #3329 (I tried to append my experience to that bug, but the bugdb sent me here.) It took me 5 minutes to figure out what the problem was. Anyway, I guess this was a bit counter-intuitive. I can see Jeff's point about not wanting to trace a local var, although I write code all the time to do timeouts in non-event driven apps that would exploit even local vars, if I could. In general, I think we should facilitate tools that limit global vars. At least, it would be nice to allow vwait on namespace vars, if not locals. Instead, I have to do vwait name::space::var For example, proc timed_connect {host port timeout} { global sem ;# would be nice if I could avoid this. at least with a namespace, or just use as a local set s [socket -async $host $port] after $timeout {set sem timeout} fileevent $s writable {set sem ready} vwait sem etc. } Thanks for updating vwait.n man page. BTW, in the 8.2.1 man page namespace.n, you write "See the section SCOPED VALUES..." but I can not find this section. It's perfectly correct to use namespace'd vars instead of global ones: (tkcon) 50 % namespace eval ::foo { variable bar 1 } (tkcon) 51 % after 10000 set ::foo::bar 20 after#3 (tkcon) 52 % vwait ::foo::bar ; puts hello hello but the var must just be globally scoped ( it would be dangerous to say just 'bar', always use the '::foo::bar' construct instead, or combine with [namespace current]). -- 05/15/2000 hobbs But the user points our that simple, defined local vwaits would be useful. The problem is that you couldn't actually effect the above after, or set the sem that way - after always occurs at the global scope as well. Since you can't reenter into that same ephemeral proc scope, you can't use vwait in this way. -- 05/15/2000 hobbs - foundin initialized to: "obsolete: 8.2.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "07. Variables"
- title initialized to: "vwait should allow local scope"
- type initialized to: "Bug"
Ticket change [0f4153a018] (rid 94755) by welch on 2000-10-26 08:21:18:
- closedate changed to: "2000-10-26T01:21:18"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"