namespace delete
Removes namespaces with their commands, variables, and namespaces.
namespace delete ?NS ...?
Description
Removes each NS, with each command, variable, and namespace in it. With no NS it does nothing. A NS that does not exist is an error, and the namespaces before it in the call are already gone.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| NS | namespace name | none | A namespace to remove. |
Returns
An empty string.
Examples
% namespace eval d1 {proc f {} {}; variable v 1}
> namespace delete d1
> list [namespace exists d1] [info commands d1::f]
0 {}
# The namespaces in d4 go with it.
% namespace eval d4::in {}
> namespace delete d4
> namespace exists d4::in
0
% namespace delete
Errors
% namespace delete nope
unknown namespace "nope" in namespace delete command
-errorcode NONE
Differences from Tcl
- Tcl 8.6 checks each NS before it removes one, so a NS that does not exist leaves each namespace of the call.
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1