|
2001-04-17
| ||
| 04:31 | • Ticket [218015ffff] Problems using upvar with aliased procs status still Clo... artifact: b23aae8fcc user: dgp | |
|
2000-10-26
| ||
| 08:12 | • Closed ticket [218015ffff]. artifact: 7ec5ec7505 user: welch | |
| 00:52 | • New ticket [218015ffff]. artifact: d1b15aed88 user: nobody | |
Problems using upvar with aliased procs
Closed / Fixed218015ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:12
OriginalBugID: 929 Bug
Version: 8.1a2
SubmitDate: '1998-12-04'
LastModified: '1999-04-19'
Severity: SER
Status: Closed
Submitter: welch
ChangedBy: rjohnson
OS: Windows NT
Machine: X86
FixedDate: '2000-10-25'
ClosedDate: '1998-12-08'
Name:
Lucio Ferrao
CVS:
1998/12/04 ($Id: tclInterp.c,v 1.1.2.4 1998/11/11 04:54:15 stanton Exp $)
ReproducibleScript:
#!/usr/bin/tclsh
proc mySet {varName value} {
upvar 1 $varName localVar
set localVar $value
}
interp alias {} myNewSet {} mySet
proc testMyNewSet {value} {
myNewSet a $value
return $a
}
testMyNewSet "hi"
ObservedBehavior:
can't read "a": no such variable
while executing
"return $a"
(procedure "testMyNewSet" line 3)
invoked from within
"testMyNewSet "hi""
DesiredBehavior:
testMyNewSet should return "hi"
Patch:
*** generic/tclInterp.c Thu Dec 3 22:10:02 1998
--- generic/tclInterp.c.new Fri Dec 4 14:48:34 1998
***************
*** 1407,1413 ****
cmdPtr = Tcl_NewListObj(prefc, prefv);
Tcl_ListObjReplace(NULL, cmdPtr, prefc, 0, objc - 1, objv + 1);
Tcl_ListObjGetElements(NULL, cmdPtr, &cmdc, &cmdv);
! result = TclObjInvokeGlobal(targetInterp, cmdc, cmdv,
TCL_INVOKE_NO_TRACEBACK);
Tcl_DecrRefCount(cmdPtr);
--- 1407,1413 ----
cmdPtr = Tcl_NewListObj(prefc, prefv);
Tcl_ListObjReplace(NULL, cmdPtr, prefc, 0, objc - 1, objv + 1);
Tcl_ListObjGetElements(NULL, cmdPtr, &cmdc, &cmdv);
! result = TclObjInvoke(targetInterp, cmdc, cmdv,
TCL_INVOKE_NO_TRACEBACK);
Tcl_DecrRefCount(cmdPtr);
PatchFiles:
generic/tclInterp.c
This is not a bug. Aliases are supposed to be invoked at the global level, much like bindings. I will update the documentation to reflect this clarification.
We changed this - it will be the 8.0 behavior. Backwards compatability prevails. 04/19/1999 18:19 - rjohnson -
welch Closed ticket [218015ffff].
[History diff]2000-10-26 08:12:12
dgp Ticket [218015ffff]: 3 changes
[History diff]2001-04-17 04:31:29
Log in (anonymous is fine) to add a comment.