namespace import command causes one Tclx command to not be f
Closed / Invalid218334ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:56:22
OriginalBugID: 3947 Bug
Version: 8.0.3
SubmitDate: '1999-12-27'
LastModified: '2000-06-27'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: ericm
RelatedBugIDs: 3531
OS: Linux-Red Hat
OSVersion: Linux 5.2
Machine: PC with Pentium II 400/256 MB RAM
FixedDate: '2000-10-25'
ClosedDate: '2000-06-27'
Name:
Charles Shartsis
Extensions:
Tclx 8.0.3 patchlevel 0
CustomShell:
No modifications or patches
ReproducibleScript:
Run the below script with and without the namespace import command commented out.
#!/bin/sh
# Run tclsh from the PATH exec tclsh "$0" "$@"
package require Tclx
puts "Tcl version is [info tclversion] (my system is 8.0)"
puts "Tcl patchlevel is [info patchlevel] (tried it with 8.0.3 and 8.0.5)"
puts "TclX version is [infox version] (my system is 8.0.3)"
puts "Tclx patchlevel is [infox patchlevel] (my system is 0)"
namespace eval Lib {}
proc Lib::Aproc {} {
translit a b c
set a(1) 1
for_array_keys key a { puts "It works" }
}
# It works with next line commented out. Why?
namespace import Lib::Aproc
Lib::Aproc
ObservedBehavior:
I frankly don't know whether this is a problem with Tcl or extended Tcl. Then again, maybe there is no problem and I am extremely confused.
Refer to the above script (which is an extremely simplified version of the script which originally manifested the problem). Note that both translit and for_array_keys are extended tcl commands. If you comment out the namespace import command, the script runs fine and prints "It works". If you run the script with the namespace import command not commented out, you get the following stack trace:
invalid command name "for_array_keys"
while executing
"for_array_keys key a { puts "It works" }"
(procedure "Lib::Aproc" line 5)
invoked from within
"Lib::Aproc"
(file "./bug.tcl" line 25)
DesiredBehavior:
I have two observations:
1) With or without the namespace import command, there should be no error
2) If extended Tcl commands cannot be found in Lib::Aproc, then it seems to me that the failure should occur at the translit command which precedes the for_array_keys command. Both are extended Tcl commands.
I am unable to duplicate this behavior with Tcl 8.0.5/Tclx 8.0.3, or with Tcl 8.4a1/Tclx 8.2, on Redhat 6.0. Perhaps it was a problem with the libraries on Redhat 5.2.
- eric
-- 06/27/2000 ericm
welch Closed ticket [218334ffff].
[History diff]2000-10-26 08:20:07
dgp Ticket [218334ffff]: 4 changes
[History diff]2001-04-16 22:49:25
Log in (anonymous is fine) to add a comment.