Overview
| Artifact ID: | e0ef59f898afacfc0e9ecb5d230a55178edd75e4 |
|---|---|
| Ticket: | 926590ffffffffffffffffffffffffffffffffff
Re-entering an interp keeps procedure context |
| User & Date: | jaspert on 2004-03-31 10:38:20 |
Changes
- assignee changed to: "hobbs"
- cmimetype changed to: "text/plain"
- comment changed to:
Not sure if this is a bug, but it seems very strange to me and there is no mention in the documentation. Normally if you execute a command in an interp using [interp eval] then that command is executed in global context. However if it is executed as part of a procedure in the parent interp that has been called by alias from another procedure in the same slave interp, then the command is executed in that slave interp procedure's context. I would expect it to go back to global context. Here's an example: /usr/local/ActiveTcl/bin/wish % info patchlevel 8.4.6 % set foo [interp create] interp0 % $foo eval set nodecount 100 100 % $foo eval set nodecount 100 % $foo alias bar bar bar % proc bar {} {global foo; $foo eval set nodecount} % bar 100 % $foo eval bar 100 % $foo eval [list proc oink {} {bar}] % $foo eval oink can't read "nodecount": no such variable # next bit shows that if slave is entered from a different slave rather than itself, context is global % set foo2 [interp create] interp1 % $foo2 alias bar bar bar % $foo2 eval [list proc oink {} {bar}] % $foo2 eval oink 100 - foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "jaspert"
- subsystem changed to: "20. [interp]"
- title changed to: "Re-entering an interp keeps procedure context"
- type changed to: "Bug"