Skip to content
Tcl Source Code History Of Ticket 9a2bc209faf87b2f
Login

History Of Ticket 9a2bc209faf87b2f

Artifacts Associated With Ticket 9a2bc209faf87b2f

  1. Ticket change [bc5c6ceec3] (rid 154279) by dgp on 2017-06-06 16:37:46:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      % proc demo a {upvar 1 $a[proc upvar args {puts WOW}] b}
      % demo v
      % 
      
      Should print "WOW"
      
      Contrast with:
      % proc demo a {set u upvar; $u 1 $a[proc $u args {puts WOW}] b}
      % demo v
      WOW
      %
      
    5. foundin initialized to: "all"
    6. is_private initialized to: "0"
    7. login: "dgp"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "dgp"
    13. subsystem initialized to: "47. Bytecode Compiler"
    14. title initialized to:
      Bytecode machinery to handle compile epoch bumps is not right.
      
    15. type initialized to: "Bug"
  2. Ticket change [677859b8a9] (rid 154283) by sebres on 2017-06-06 17:24:36:

    1. icomment:
      I think it may be a false reasoning...
      
      In this case more interesting the question "When exactly the command resolving
      should take place - before or after the arguments will be substituted?".
      
      So in my opinion, it works as expected...<br/>
      Because I guess the substitution of argv[0] (command) should be made exactly 
      the same manner as substitution of following arguments (argv[1]...argv[N]).
      
      Trying to execute it twice:
      <code><pre>
      % proc demo a {upvar 1 $a[proc upvar args {puts WOW}] b}
      % demo a
      % demo a
      WOW
      %
      </pre></code>
      
      So corresponding to my question above, either the execution is correct at all,
      because we targeted here not yet changed "upvar", that will be modified after
      1st execution only.
      
      Or it is wrong, if resolving should take place implicit after substitution of
      the command arguments (I'm definitively against).
      
      In my opinion this does not differ from the following logic (why it should be
      different by the command resolving?):
      <code><pre>
      % set x 1
      1
      % concat $x [incr x]
      1 2
      % concat $x [incr x]
      2 3
      </pre></code>
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  3. Ticket change [ef2db6b1c2] (rid 154284) by sebres on 2017-06-06 17:49:02:

    1. icomment:
      IMHO rather the second example (your contrast example with "set u upvar; $u 1 $a[...") is wrong...
      
      Please note this "undefined behavior" is very-very old - both variants behave this way at least since tcl-8.5.
      
      But I assume that by tcl-8.4 the first variant ("upvar 1 $a[proc upvar ...") still  printed "WOW" (just because another order of the "compilation" process).
      
    2. login: "sebres"
    3. mimetype: "text/plain"
  4. Ticket change [4e7b29399b] (rid 154299) by emiliano on 2017-06-07 02:38:47:

    1. icomment:
      Duplicated of http://core.tcl.tk/tcl/tktview/1812624 ?
      
    2. login: "emiliano"
    3. mimetype: "text/plain"
  5. Ticket change [dd35bf15dc] (rid 154371) by dgp on 2017-06-08 11:26:27:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2457912.97670439"
    3. closer changed to: "dgp"
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Duplicate"
    7. status changed to: "Closed"