Skip to content
Tcl Source Code History Of Ticket 3075907
Login

History Of Ticket 3075907

Artifacts Associated With Ticket 3075907

  1. Ticket change [f41882335a] (rid 129840) by msofer on 2010-09-26 12:53:43:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "msofer"
    10. subsystem initialized to: "07. Variables"
    11. title initialized to:
      [info vars] implementation and man page do not agree
      
    12. type initialized to: "Bug"
  2. Ticket change [524bd0c956] (rid 126293) by msofer on 2010-09-27 16:15:05:

    1. icomment:
      Note that the current behaviour is difficult to implement correctly in the presence of variable resolvers, as used eg by TclOO: see #3075155
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [7c1591ec2b] (rid 97019) by msofer on 2010-09-27 16:33:38:

    1. 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
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. priority changed to: "9 Immediate"
    5. username: "msofer"
  4. Ticket change [ccb3088636] (rid 95743) by msofer on 2010-09-27 22:43:30:

    1. 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.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  5. Ticket change [e4f2586e5d] (rid 88039) by hobbs on 2010-09-27 23:29:09:

    1. 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.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. priority changed to: "5 Medium"
    5. username: "hobbs"
  6. Ticket change [ebd9a6fa00] (rid 103600) by hobbs on 2010-09-27 23:29:53:

    1. closedate changed to: "2010-09-27T16:29:53"
    2. closer changed to: "hobbs"
    3. resolution changed to: "Wont Fix"
    4. status changed to: "Pending"
  7. Ticket change [55985dc708] (rid 94163) by msofer on 2010-09-27 23:49:52:

    1. closedate changed to: "2010-09-27T16:49:52"
    2. closer changed to: "msofer"
    3. icomment:
      
      
      allow_comments - 1
      
      OMG, I now believe I misread the docs - this is no bug. As you were ...
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "msofer"
  8. Ticket change [e54694db76] (rid 88099) by jenglish on 2010-09-28 04:52:24:

    1. 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.
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"