Skip to content
Tcl Source Code History Of Ticket 50f67a3ace
Login

History Of Ticket 50f67a3ace

Artifacts Associated With Ticket 50f67a3ace

  1. Ticket change [8ae37f9f6e] (rid 140768) by msofer on 2014-11-27 20:02:24:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      There seems to be a problem with commands redefining themselves in their own arguments. Consider the script
      
      <verbatim>
        mig@MTP:~/DEVEL/tcl-core/trunk/unix$ cat TT 
        proc history args {}
        set x [proc set args {puts FOO}]42
        puts $x
      </verbatim>
      
      There are 3 ways in which we can run this: './tclsh TT', 'source TT', or typing it directly at the command line. The first works properly: the command [set] is replaced *before* it is used, the variable x is never set.
      
      The third variant, typing it at the command line, misbehaves since ... forever? Doing this sets the variable x to 42, the command [set] is redefined *after* it is used.
      
      The second variant used to work properly until [42090a4d6], where it started replacing after use.
      
    5. foundin initialized to: "8.6.3"
    6. is_private initialized to: "0"
    7. login: "msofer"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "214bb5765a5d2d4513fe393de9e8c8431e3e869a"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "msofer"
    14. subsystem initialized to: "47. Bytecode Compiler"
    15. title initialized to: "INST_START_CMD bug?"
    16. type initialized to: "Bug"
  2. Ticket change [5a65c9729e] (rid 140769) by msofer on 2014-11-27 20:03:24:

    1. assignee changed to: "dkf"
    2. icomment:
      Assigning to dkf for comment - I believe he's the last one to have looked at INST_START_CMD.
      
    3. login: "msofer"
    4. mimetype: "text/plain"
  3. Ticket change [af364c3058] (rid 140792) by dkf on 2014-12-03 23:24:45:

    1. icomment:
      The compiled version has been this way since 8.0, and the difference you observe is that we now compile <tt>source</tt> (as part of NRE-enabling it, which is useful for things like templating engines in coroutine-based web servers). It's very hard to avoid this sort of thing when compiling; you've got to have the ability to do things in a bit different order (especially to handle arguments like that) or you end up going crazy trying to generate code.
      <p>
      I continue to suggest that people relying on redefining commands that are being executed are in for a world of pain, and that this will get worse in 9.0. Indeed, I ought to propose changing the point where Tcl looks up the command implementation to immediately after the first word is read, even though dispatch to it won't happen until after all arguments are examined, since that would enormously simplify many things (while causing much hurt for people who do the most awful things). That's the sort of subtle change that would help compilation a lot by letting us ignore the worst cases entirely.
      <p>
      Except that it causes problems with autoloading. My brain hurts!
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  4. Ticket change [62bb9bb583] (rid 140805) by msofer on 2014-12-04 00:37:55:

    1. icomment:
      I agree 110% with your proposal to change Tcl.n to resolve earlier.
      
      In the meantime, handling this is part of the job of INST_START_CMD. I think the problem could well be that we are not issuing enough of that instruction?
      
    2. login: "msofer"
    3. mimetype: "text/plain"
  5. Ticket change [c0eea2ab10] (rid 140922) by dkf on 2014-12-11 13:17:47:

    1. login: "dkf"
    2. mimetype: "text/plain"
    3. priority changed to: "4"