From: <no...@so...> - 2001-02-07 18:34:42
|
Bug #131259, was updated on 2001-Feb-06 06:43 Here is a current snapshot of the bug. Project: Tcl Category: Namespaces Status: Open Resolution: None Bug Group: 8.4a2 Priority: 5 Submitted by: msofer Assigned to : nobody Summary: cmdRefEpoch not updated Details: According to the comments for the function TclResetShadowedCmdRefs in generic/tclNamesp.c the following should not happen: % #define a namespace proc that uses the global command 'set' % namespace eval mig {proc test {} {set ::g 0}}; mig::test 0 % % #define a namespace proc 'set' that shadows the global command; % #the previously compiled 'test' never notices! % namespace eval mig {proc set {a b} {::set a [incr b]}}; mig::test 0 % #>>>>>>>>>>> % #? Shouldn't the namespace epoch have been bumped up by the % #shadowing, ? so that all procs are recompiled? % #>>>>>>>>>>> % % #if I redefine, and hence force recompilation of 'test', it is ok.) % namespace eval mig {proc test {} {set ::g 0}}; mig::test 1 Follow-Ups: Date: 2001-Feb-07 10:35 By: msofer Comment: It seems to be a deeper bug; some global commands (eg, set) are compiled directly to bytecode. Commands that shadow *them* are immune to the implementation of the 'reset on shadowing': it invalidates command *references* in the bytecode, but there is no command reference to 'set' in there! Maybe shadowing should force recompilation of the proc, and not just a fresh resolution of command names? In that case, a small patch to TclProcCompileProc (generic/tclProc.c) would arrange it. ------------------------------------------------------- Date: 2001-Feb-06 08:06 By: msofer Comment: Sorry for the title, it is way too specific and maybe misleading! A correct title would be * Incorrect command scoping * I do not actually know if, in the example above, cmdRefEpoch was not updated, or if it was but the bytecompiler ignored it. msofer ------------------------------------------------------- For detailed info, follow this link: http://sourceforge.net/bugs/?func=detailbug&bug_id=131259&group_id=10894 |