Skip to content
Tcl Source Code History Of Ticket 221240
Login

History Of Ticket 221240

Artifacts Associated With Ticket 221240

  1. Ticket change [ca6e0f12c7] (rid 95346) by tjamesjones on 2000-11-03 17:18:06:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      [ couldn't find this in the bug database.
       surprisingly, this "bug" is also in v8.0.5  so it
       has been around for a while]
      
      we are trying to upgrade our version of Tcl from v8.0p2.
      have discovered an odd behaviour for this Tcl code:
      
      #
      # START CODE
      #
      
      set foo 0
      
      while $foo {
              puts "first loop"
      }
      
      set foo 1
      
      while { $foo != 0 } {
              set foo 0
              puts "second loop"
      
      }
      
      set foo 1
      
      while $foo {
              set foo 0
              puts "third loop"
      }
      
      #
      # END CODE
      #
      
      you can run it from tclsh - the code gets stuck in an infinite loop on the third loop.
      doesn't look right to me, yet I can't believe noone else has noticed this?   
      
      this broke some of our code, as the behaviour under v8.0p2 was more as you'd expect, breaking out of the third loop after one iteration.
      
      maybe Tcl has changed so that you can't say "while $var" although that doesn't really explain why it works for the first of the three loops.
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.3.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "tjamesjones"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "infinite loop - behaviour change from 8.0p2"
    11. type initialized to: "Bug"
  2. Ticket change [24de845096] (rid 131181) by dgp on 2000-11-04 00:31:36:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2000-11-03T17:31:36"
    3. closer changed to: "dgp"
    4. icomment:
      1. This is not a bug.  The 8.0p2 behavior was buggy.
      
      2. This has been reported before.  See Bug 118042 for
         a detailed response.
      
      http://sourceforge.net/bugs/?group_id=10894&func=detailbug&bug_id=118042
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Duplicate"
    8. status changed to: "Closed"
    9. username: "dgp"
  3. Ticket change [a49b48e06c] (rid 110234) by welch on 2000-11-04 00:35:56:

    1. assignee changed to: "nobody"
    2. closedate changed to: "2000-11-03T17:35:56"
    3. closer changed to: "welch"
    4. icomment:
      This is a behavior change, but the bug was in 8.0p2, not in other versions.  In
      set foo 1
      while $foo {
          set foo 0
      }
      
      the $foo is substituted *before* the while command is invoked, so the while
      command doesn't see the variable reference.  (Or ought not to.  Early versions
      of the byte-code compiler in 8.0 didn't correctly implement substitution semantics
      in some control structures that have custom bytecodes generated for them.)
      
      
      
    5. login: "welch"
    6. mimetype: "text/plain"
    7. priority changed to: "1 Zero"
    8. resolution changed to: "Invalid"
    9. username: "welch"
  4. Ticket change [5ee17a6b50] (rid 115710) by tjamesjones on 2000-11-04 00:43:14:

    1. icomment:
      
       excellent thankyou.  Now we can upgrade - and I was blaming poor old Tix all along.
      
      
      
    2. login: "tjamesjones"
    3. mimetype: "text/plain"
    4. username: "tjamesjones"
  5. Ticket change [ba7f78f25a] (rid 129333) by dkf on 2000-11-06 20:08:07:

    1. closedate changed to: "2000-11-06T13:08:07"
    2. closer changed to: "dkf"
    3. subsystem changed to: "10. Objects"