Reputation: 57
Is 'namespace export ... ' necessary, in order to use the variable/procs of that namespace in a different namespace using the 'namespace import *' command. Should we really do the 'export' in the source namespace and 'import'in the destination namespace.
Upvotes: 5
Views: 1566
Reputation: 137807
All namespace export
does is make commands available for namespace import
and prompts them to appear in a simple-mode namespace ensemble
(though you've got other options for that). If you don't want to support namespace import
, you don't have to; just never export anything.
You invoke commands in another namespace using the fully-qualified syntax:
::the::other::namespace::command "some argument, as normal"
You can also use partial namespace names; that's pretty common as a leading ::
is a bit ugly...
Upvotes: 2
Reputation: 40803
In general, I don't want to do namespace import/export: I want the variables/procs to stay where they are. Importing might pollute the destination namespace, which is against the namespace's design.
Upvotes: 0