Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-16
22:56 • Ticket [218060ffff] info commands return value altered by execution of command i... artifact: 4d09652f23 user: dgp
2000-10-26
08:13 • Closed ticket [218060ffff]. artifact: 6324e0a45b user: welch
00:52 • New ticket [218060ffff]. artifact: f8efa3897e user: nobody

info commands return value altered by execution of command i

Closed / Fixed218060ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:41
OriginalBugID: 1507 Bug
Version: 8.0.3
SubmitDate: '1999-03-15'
LastModified: '1999-11-10'
Severity: SER
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: Windows NT
OSVersion: 4.0 SP4
Machine: X86
FixedDate: '2000-10-25'
ClosedDate: '1999-11-10'


Name:
Bruce Adams

ReproducibleScript:
proc putList { channel list { entryFormat "%s" } } {
    foreach item $list {
        puts $channel [ format $entryFormat $item ]
    }
}
# End Proc putList
    
namespace eval fred {
}

puts "==========="

rename info ::fred::info_builtin
proc info { subcommand args } {
    return [eval ::fred::info_builtin $subcommand $args]
}
    
puts "BEFORE:"
putList stdout "[ info commands inf* ]"

proc info { subcommand args } {
# each of the following has the same effect
    return [namespace eval ::fred info_builtin $subcommand $args]
    #return [namespace eval ::fred ::fred::info_builtin $subcommand $args]
    #return [namespace inscope ::fred ::fred::info_builtin $subcommand $args]
}

puts "AFTER:"
putList stdout "[ info commands inf* ]"

info_builtin

ObservedBehavior:
info_builtin is wrongly reported as existing in the global namespace by
[ info commands inf* ] when it does not exist. i.e.
   info
   info_builtin

DesiredBehavior:
info commands inf*
should only return "info"
in the above script


This behaviour impacts the development of my introspection package which
amongst other things extends the semantics of info, through redefining
it and
creating a wrapper.
--

This is actually the correct behavior.  You are evaluating the
info command now in the ::fred namespace, which means that it
will pick up its new self as info_builtin.  Add the procs ::fred::inf
::fred::inf1 ... and you will see them all. 
-- 11/10/1999 hobbs
welch Closed ticket [218060ffff]. [History diff]2000-10-26 08:13:45
dgp Ticket [218060ffff]: 3 changes [History diff]2001-04-16 22:56:02
Log in (anonymous is fine) to add a comment.