Artifacts Associated With Ticket 3075907
Ticket change [f41882335a] (rid 129840) by msofer on 2010-09-26 12:53:43:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The man page states for [info vars]: "Note that a currently-visible variable may not yet “exist” if it has not been set (e.g. a variable declared but not set by variable)." However % unset -nocomplain x y % proc a {} {variable x; upvar y z; info vars} % a x z This behaviour is present at least in 8.4.19, 8.5.9 and 8.6 (did not check earlier Tcl versions). That is, it may well be a "documentation bug" by now. - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "07. Variables"
- title initialized to:
[info vars] implementation and man page do not agree
- type initialized to: "Bug"
Ticket change [524bd0c956] (rid 126293) by msofer on 2010-09-27 16:15:05:
- icomment:
Note that the current behaviour is difficult to implement correctly in the presence of variable resolvers, as used eg by TclOO: see #3075155
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [7c1591ec2b] (rid 97019) by msofer on 2010-09-27 16:33:38:
- icomment:
IMO the present behaviour is NOT correct, we should revert to the documented behaviour: the present behaviour is inconsistent in the treatment of uninitialised variables in the presence of var resolvers. To be explicit, the consistent choices are IMO are: 1. never report an unitialised variable, be it a link or not 2. report all resolved variables - impractical, difficult and expensive
- login: "msofer"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "msofer"
- icomment:
Ticket change [ccb3088636] (rid 95743) by msofer on 2010-09-27 22:43:30:
- icomment:
There seem to be no tests whatsoever for what happens with declared-but-undefined variables: [global], [variable], [upvar], [namespace upvar], OO's [variable]. The interaction with varname resolvers is impossible to bring up to the current behaviour without extending the api: we should extend Tcl_ResolverInfo to contain a listProc to be used by [info vars]. This new function would list all variable names that are able to be resolved in the current context.
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [e4f2586e5d] (rid 88039) by hobbs on 2010-09-27 23:29:09:
- icomment:
This has been the behavior in Tcl since at least Tcl 8, and I believe before. I had to deal with it in tkcon. I believe it also matches the docs. As stated in the docs, 'info vars' will return these "visible-but-not-exists", and you have to test against 'info exists' for true existence in the "is set" sense.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- username: "hobbs"
- icomment:
Ticket change [ebd9a6fa00] (rid 103600) by hobbs on 2010-09-27 23:29:53:
- closedate changed to: "2010-09-27T16:29:53"
- closer changed to: "hobbs"
- resolution changed to: "Wont Fix"
- status changed to: "Pending"
Ticket change [55985dc708] (rid 94163) by msofer on 2010-09-27 23:49:52:
- closedate changed to: "2010-09-27T16:49:52"
- closer changed to: "msofer"
- icomment:
allow_comments - 1 OMG, I now believe I misread the docs - this is no bug. As you were ...
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "msofer"
Ticket change [e54694db76] (rid 88099) by jenglish on 2010-09-28 04:52:24:
- icomment:
FWIW and IMNSHO: the semantics of [info vars] and [info locals] have always been ill-defined at best; and the in-practice semiotics seems to be "they're sometimes useful for debugging/introspection". Any test that uses them should be considered white-box.
- login: "jenglish"
- mimetype: "text/plain"
- username: "jenglish"
- icomment: