Menu

#4533 namespace inscope magic behaviour missing

obsolete: 8.6b1
closed-invalid
5
2010-02-18
2010-02-03
Jasper
No

In tcl up to 8.5, a list whose first element is a list starting with "namespace inscope" can be evaluated as if the first element had already been command-substituted, as in this example:
% {namespace inscope :: puts} foo
foo
However this does not happen in 8.6, instead you get:
invalid command name "namespace inscope :: puts"
The earlier behaviour is technically wrong, but widely used when binding with the "namespace code" command. If the new behaviour is considered "right", please reassign this bug report to refer to the old, "wrong" behaviour.

Discussion

  • miguel sofer

    miguel sofer - 2010-02-03

    Note that [namespace inscope] "... is not expected to be used directly by programmers; calls to it are generated implicitly when applications use namespace code commands to create callback scripts that the applications then register with, e.g., Tk widgets". The manpage only states that
    namespace inscope ::foo $script $x $y $z
    is equivalent to
    namespace eval ::foo [concat $script [list $x $y $z]]

    The documented functionality is still present in 8.6, the pair [ns code]/[ns inscope] and the documented equivalence work properly. Or else there really is a bug somewhere: if you have a script where that malfunctions, please attach it here.

    The previous (undocumented) magic is gone as of 2008-08-06. If you still need it, see itcl's ticket http://sourceforge.net/tracker/index.php?func=detail&aid=2040295&group_id=13244&atid=313244 for a small script that restores it in your interp.

     
  • miguel sofer

    miguel sofer - 2010-02-03
    • status: open --> pending-invalid
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-invalid --> closed-invalid
     
MongoDB Logo MongoDB