Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3734b1de2054f2a8d6f5efc96b8fba4f00e493f7
Ticket: 218627ffffffffffffffffffffffffffffffffff
tcl8.0.4 puts misbehaves in context of expr
User & Date: nobody on 2000-10-26 01:03:19
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1508 Bug
    Version: 8.0.4
    SubmitDate: '1999-03-15'
    LastModified: '1999-08-07'
    Severity: SER
    Status: Released
    Submitter: pat
    ChangedBy: hobbs
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '1999-08-07'
    FixedInVersion: 8.0.5
    ClosedDate: '2000-10-25'
    
    
    Newsgroups: comp.lang.tcl
    From: [email protected] (Robert R. Henry)
    Subject: tcl8.0.4 puts misbehaves in context of expr
    Date: Thu, 4 Mar 1999 22:43:23 GMT
    Xref: news3.best.com comp.lang.tcl:93456
    
    
    When using tcl8.0.4, built in a vanilla fashion for either sunos or solaris,
    the following procedure executes in a manner I find pathological:
    
      proc x {} {
        puts "0x7"
        puts "0x3"
        expr  7
        expr  0x3
        return
      }
    
    The first puts outputs 3 characters (here indented for clarity):
      0x7
    the second puts outputs ONLY 1 character
      3
    
    If I comment out the line that evaluates the expr involving 0x3,
    then both puts output 3 characters, 0x7 and then 0x3.
    
    If I change the quotes from "" in the puts statements to {},
    then I still get the SAME behaviour. {} are being volated!
    
    If I had to hazard a guess, the byte code compiler constructs a single
    internal normalized representation of the value 3 (or 0x3), which it then
    uses in both the puts and in the expr.
    
    needless to say this behaviour is quite unexpected, especially for the {}
    quoting case, and it is also different than tcl7.4
    
    Robert R. Henry
    [email protected]
    
    
    
    This overaggressive compiler behavior was fixed in 8.0.5 and
    the 8.1+ versions. 
    -- 08/07/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.0.4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "62. (unused)"
  10. title changed to: "tcl8.0.4 puts misbehaves in context of expr"
  11. type changed to: "Bug"