How do I remove a Tcl procedure?
سؤال
How do I remove a tcl procedure?
One can
unset
a variable,- override an alias with
interp alias {} myproc {} otherproc
, - override a proc with one defined inside another namespace with
namespace import -force
.
But I did not find a way to make a procedure unknown.
المحلول
Use rename
to delete a proc
rename myproc ""
Example:
% proc myproc {} {
puts "hello world"
}
% myproc
hello world
% rename myproc ""
% myproc
invalid command name "myproc"
%
لا تنتمي إلى StackOverflow