Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 442ac98c94fc501d546b65ef66b5399cd8af548d
Ticket: 219384ffffffffffffffffffffffffffffffffff
inconsistent [return] at level #0
User & Date: nobody on 2000-10-26 05:12:05
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 6103 Bug
    Version: 8.3.1
    SubmitDate: '2000-08-09'
    LastModified: '2000-10-25'
    Severity: SER
    Status: UnAssn
    Submitter: techsupp
    OS: All
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    Don Porter
    
    Comments:
    The source of the problem is in tclParse.c,
        in the routine Tcl_EvalTokens():
        
                    case TCL_TOKEN_COMMAND:
                        code = Tcl_EvalEx(interp, tokenPtr->start+1,
        tokenPtr->size+2,
                                0);
                        if (code != TCL_OK) {
                           goto error;
                        }
        
        This code effectively converts all non-TCL_OK return codes
        into a TCL_ERROR return code, which is not correct.  I don't
        see an immediate fix, though, since Tcl_EvalTokens() returns
        a Tcl_Obj, not a Tcl return code.  There doesn't seem to be
        any channel for passing back the return code to the caller.
        
        This same problem is the cause of bug report #2136, and it
        may be related to other bug reports linked to #2136.
        
        BTW, the status of ticket #2136 is "Assigned".  Any way
        to find out to whom it was assigned?
    
    ReproducibleScript:
    $ cat demo1.tcl
    # FILE: demo1.tcl
    puts [info patchlevel]
    return
    
    $ cat demo2.tcl
    # FILE: demo1.tcl
    puts [info patchlevel]
    list [return]
    
    ObservedBehavior:
    $ tclsh8.0 demo1.tcl
    8.0.5
    
    $ tclsh8.0 demo2.tcl
    8.0.5
    
    $ tclsh demo1.tcl
    8.3.1
    
    $ tclsh demo2.tcl
    8.3.1
     
        while executing
    "list [return]
    "
        (file "demo2.tcl" line 3)
    
    DesiredBehavior:
    I expect the [return] command at level #0 of
    evaluation to behave the same whether it is 
    invoked directly, or as part of a command
    substitution.  Tcl 8.0.5 gets it right.
    Tcl 8.1.0 and every Tcl since gets it wrong,
    as demonstrated above using Tcl 8.3.1.
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.3.1"
  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: "69. Other"
  10. title changed to: "inconsistent [return] at level #0"
  11. type changed to: "Bug"