Skip to content
Tcl Source Code View Ticket
Login

View Ticket

[interp alias] inconsistency

Closed / Fixed218638ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:03:33
OriginalBugID: 1556 Bug
Version: 8.1b2
SubmitDate: '1999-03-19'
LastModified: '1999-04-05'
Severity: SER
Status: Released
Submitter: pat
ChangedBy: stanton
RelatedBugIDs: 1153
OS: Other
Machine: NA
FixedDate: '1999-04-05'
FixedInVersion: 8.1b3
ClosedDate: '2000-10-25'


Name:
Don Porter

ReproducibleScript:
    # FILE: test.tcl
    proc foo0 {} {
        set lvl 0
        while {![catch {info level $lvl} res]} {
            puts "Level $lvl: $res"
            incr lvl -1
        }
        puts "Exit loop: $res"
    }
    proc foo1 {} {foo0}
    interp alias {} bar1 {} foo1
    proc foo2 {} {bar1}
    foo2
    
    



ObservedBehavior:
    $ tclsh8.0 test.tcl
    Level 0: foo0
    Level -1: bar1
    Level -2: foo2
    Exit loop: bad level "-3"
    
    $ tclsh8.1 test.tcl
    Level 0: foo0
    Level -1: foo1
    Exit loop: bad level "-2"
    
    



DesiredBehavior:
    Consistent operation in Tcl 8.0 and Tcl 8.1 .
    



Patch:
A partial fix is provided by the patch available at

http://www.dejanews.com/getdoc.xp?AN=418629997




PatchFiles:
    tclInterp.c 
    




The 8.1 behavior may actually be the correct behavior.  The issue is what level the alias is invoked at.  The "correct" behavior should have been back-ported into Tcl 8.0.5.  This should be verified.
03/23/1999 19:20 - surles -

The 8.0 behavior is to invoke the alias at the current scope in the target interpreter, so the 8.1 behavior is an incompatible change and should be fixed.
04/05/1999 18:26 - stanton -
welch Closed ticket [218638ffff]. [History diff]2000-10-26 08:26:09
dgp Ticket [218638ffff]: 3 changes [History diff]2001-04-17 05:41:38
Log in (anonymous is fine) to add a comment.