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"
%
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top