Skip to content
Tcl Source Code History Of Ticket 420507ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 420507ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 420507ffffffffffffffffffffffffffffffffff

  1. Ticket change [e24514dcd0] (rid 87592) by msofer on 2001-05-01 18:03:56:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      There is an inconsistency in the handling of [unknown]:
      the bytecode engine always calls the global [unknown],
      the direct eval engine calls [unknown] in the local
      namespace. The following illustrates the bug:
      
      % info patchlevel
      8.4a2
      % namespace eval mig {set l aaa}
      aaa
      % proc unknown args {puts global}
      % proc mig::unknown args {puts local}
      % namespace eval mig {$l}
      global
      % namespace eval mig {eval $l}
      local
      
      It is quite straightforward to patch the source to
      obtain a consistent behaviour. The patch will be either
      in generic/tclExecute.c (to get the bytecode compiler
      to call the namespace [unknown]), or else in
      generic/tclParse.c.
      
      I do not know which of the two behaviours is the
      correct one! The man page for 'unknown' does not
      resolve the issue. OTOH, the behaviour was consistent
      in 8.0.5 (always call [::unknown]):
      
      % info patchlevel
      8.0.5
      % namespace eval mig {set l aaa}
      aaa
      % proc unknown args {puts global}
      % proc mig::unknown args {puts local}
      %  namespace eval mig {$l}
      global
      % namespace eval mig {eval $l}
      global
      
      I have not tested other versions.
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "7 High"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "msofer"
    9. subsystem initialized to: "45. Parsing and Eval"
    10. title initialized to: "Inconsistent behaviour of [unknown]"
    11. type initialized to: "Bug"
  2. Ticket change [91d5d5de70] (rid 120685) by dgp on 2001-05-02 03:25:45:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      The change in behavior occurred between Tcl
      releases 8.2.3 and 8.3b1.  Using diffs, the
      ChangeLog, and 'cvs annotate', determine what
      code changes created the changed behavior,
      and who made them.  Find out from them whether
      this was an intended effect (I doubt it).
      
      Unless they say yes, I think the change in
      behavior within the 8.x releases was a bug,
      and the 8.0 behavior should be restored.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [56878aae44] (rid 94338) by msofer on 2001-05-02 23:06:22:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      As far as I can tell:
      
      (a) The bytecode engine has called the global [unknown] ever
      since 8.0 (see {generic/tclExecute.c: TclExecuteByteCode,
      INST_INVOKE} and {generic/tclBasic.c TclObjInvoke}
      
      (b) The inconsistency was introduced in 8.1, with the parser
      rewrite and the possibility of direct interpretation: the
      new procedure Tcl_EvalObjv calls the namespace [unknown],
      not the global one
      
      (c) The inconsistency was exposed to scripts in 8.3, with
      the "pure list optimisation" that allows a direct evaluation
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Add attachment "DIFF" [c25907c566] (rid 111470) by msofer on 2001-05-03 06:28:18.

  5. Ticket change [b8dc1589a0] (rid 129032) by msofer on 2001-05-03 06:28:18:

    1. assignee changed to: "hobbs"
    2. icomment:
      
      
      File Added - 5939: DIFF
      
      Logged In: YES 
      user_id=148712
      
      The enclosed patch "DIFF" restores the behaviour of 8.0,
      i.e., always call the global [unknown].
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. username: "msofer"
  6. Ticket change [8f0bcec6c1] (rid 120218) by msofer on 2001-05-03 21:36:41:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Correction: the bug is exposed to tcl scripts ever since it
      was created in 8.1 - namespace eval does a direct evaluation
      only if it has multiple arguments. Therefore we should get
      in 8.1 (for the same definitions of unknown as in the
      original comment):
      
      % namespace eval mig aaa
      global
      % namespace eval mig aaa bbb
      local
      % namespace eval mig {aaa bbb}
      global
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  7. Ticket change [0669f75d28] (rid 89223) by dgp on 2001-05-03 21:46:15:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      I assure you, Miguel, the behavior change takes
      place between 8.2.3 and 8.3b1.  Regardez:
      
      $ cat un.tcl
      puts [info patchlevel]
      namespace eval mig {set l aaa}
      proc unknown args {puts global}
      proc mig::unknown args {puts local}
      namespace eval mig {$l}
      namespace eval mig {eval $l}
      namespace eval mig [list eval aaa]
      namespace eval mig [list aaa]
      namespace eval mig eval aaa
      namespace eval mig aaa
      
      $ /usr/local/src/tcl8.2.3/unix/tclsh un.tcl
      8.2.3
      global
      global
      global
      global
      global
      global
      $ /usr/local/src/tcl8.3b1/unix/tclsh un.tcl
      8.3b1
      global
      local
      local
      global
      local
      global
      
      Have you identified what change in that time frame
      caused this bug?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [184a01c9f1] (rid 122634) by msofer on 2001-05-04 00:47:04:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Clarification: 
      * the bug is exposed since 8.1, exposed by
          proc unknown args {puts global}
          namespace eval mig {
              proc unknown args {puts local}
          }
          namespace eval mig aaa ;        #  global
          namespace eval mig aaa bbb;   #  local
          namespace eval mig {aaa bbb}; # global
      
      * the modifications that created the "pure lists"
      optimisation for eval (8.3) led to a further exposure of the
      bug. The original script only shows this second exposure.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  9. Ticket change [e4f5829dbf] (rid 88046) by hobbs on 2001-05-04 03:29:10:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      The patch from Miguel restores the unknown call to always 
      ensure ::unknown, which seems correct.  Unless you want to 
      be able to override unknown in a namespace, but that isn't 
      defined anywhere, nor does it work currently (as the 
      examples below show).  I recommend applying the patch from 
      Miguel as is.  That also makes things consistent with the 
      actual unknown docs (which make no allowance for any other 
      unknown but the global one).
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. username: "hobbs"
  10. Ticket change [43a7754114] (rid 116600) by msofer on 2001-05-04 04:18:24:

    1. closedate changed to: "2001-05-03T21:18:24"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Patch registered as #421166 and committed.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "msofer"
  11. Ticket change [4db1484de9] (rid 127090) by msofer on 2001-05-07 08:02:20:

    1. closedate changed to: "2001-05-07T01:02:20"
    2. closer changed to: "msofer"
    3. resolution changed to: "Fixed"
  12. Ticket change [2d5a62e0ee] (rid 119056) by coldstore on 2004-09-22 09:39:51:

    1. icomment:
      Logged In: YES 
      user_id=19214
      
      For what it's worth, it seems to me that this inconsistency
      was resolved in the least useful way.
      
      Overriding unknown in a namespace would be a useful
      facility, qv TIP 181
      
      
      
    2. login: "coldstore"
    3. mimetype: "text/plain"
    4. username: "coldstore"