Re: After I overload "switch" command, how can I get back the original "switch" function back?
- From: Don Porter <dgp@xxxxxxxx>
- Date: Tue, 26 Sep 2006 11:08:17 -0400
pheobe wrote:
I am planning to overlad "switch" command in my application, and use
it do something, yet after that, how can I get back the original
function of "switch" ? I don't want to use the overlad "switch" all
through my appliction. Any body can help me?
Write your own [switch] command in your own namespace:
namespace eval pheobe {
namespace export switch
proc switch args {...}
}
Use [namespace import ::pheobe::switch] to bring it into other
namespaces where you want to use it.
In any namespace where you have your [switch] imported, but you want to use Tcl's built-in [switch] command, access it via the fully qualified command name [::switch].
Please completely ignore anyone recommending [rename] as an answer to your question. They are still living in Tcl 7 land (aka 1997).
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.
- Follow-Ups:
- References:
- Prev by Date: Re: Need Help in Loop Foreach
- Next by Date: Re: is tcl/tk dying out?!
- Previous by thread: Re: After I overload "switch" command, how can I get back the original "switch" function back?
- Next by thread: Re: After I overload "switch" command, how can I get back the original "switch" function back?
- Index(es):
Relevant Pages
|