SimpleNamespace v1.0
The Simple Development Library namespaces and qualified names handling
Project: the Simple Development Library.
::Simple::Namespace::cget
::Simple::Namespace::configure
::Simple::Namespace::information exists
namespace::Simple::Namespace::qualifiers
name::Simple::Namespace::qualify
name ?levels?::Simple::Namespace::cget
::Simple::Namespace::configure
::Simple::Namespace::information exists
namespace::Simple::Namespace::qualifiers
name::Simple::Namespace::qualify
name ?levels?Synopsis: the Simple Development Library namespaces and qualified names handling.
Keywords: namespace, qualify and qualifiers.
This package provides utilities for namespaces and qualified names handling. Procedures are provided for qualifying names, obtaining qualified names qualifiers and assessing whether a namespace exists.
Use ::Simple::Namespace::qualifiers
to obtain a namespace leading qualifiers, ::Simple::Namespace::qualify
to qualify a name and ::Simple::Namespace::information exists
to assess whether a namespace exists.
Date | Reason |
23-apr-2000 | First public release, version 0.2 |
10-sep-2001 | Second public release, version 0.4 |
17-feb-2003 | Third public release, version 0.5 |
22-jun-2005 | The Simple Development Library version 1.0 |
Copyright (C) 1999-2005, Juan C. Gil (jgil@gmv.es).
Paradigm: procedural.
Requisites: SimplePackage 1.0
.
None.
None.
::Simple::Namespace
::Simple::Namespace::Priv
::Simple::Namespace::cget
Synopsis: gets the package options.
Details: see section 4.1.
::Simple::Namespace::configure
Synopsis: configures the package options.
Details: see section 4.2.
::Simple::Namespace::information exists
namespaceSynopsis: returns whether a namespace exists.
Details: see section 4.3.
::Simple::Namespace::qualifiers
nameSynopsis: returns leading namespace qualifiers.
Details: see section 4.4.
::Simple::Namespace::qualify
name ?levels?Synopsis: qualifies a name up the calling stack.
Details: see section 4.5.
None.
None.
::Simple::Namespace::cget
Synopsis: gets the package options.
Access mode: public.
Arguments: none.
Returns: the requested option value or the whole list of options if none specified.
::Simple::Namespace::configure
Synopsis: configures the package options.
Access mode: public.
Arguments: none.
Returns: the "package with no options" error is thrown.
::Simple::Namespace::information exists
namespaceSynopsis: returns whether a namespace exists.
Access mode: public.
Arguments:
Argument | Type | Default value/ choices | Description |
namespace | namespace | (n/a) | Namespace |
Returns: whether the namespace exists.
::Simple::Namespace::qualifiers
nameSynopsis: returns leading namespace qualifiers.
Access mode: public.
Keywords: namespace, qualify and qualifier.
This procedure returns any leading namespace qualifers for a variable or procedure name. It is similar to the namespace qualifiers
command but works in such a way that for any name the concatenation of the value returned by this procedure and the result of namespace tail
equals the original name as follows:
Name | namespace qualifiers |
This procedure | namespace tail |
{} | {} | {} | {} |
foo | {} | {} | foo |
foo::bar | foo | foo:: | bar |
foo::::bar | foo | foo:::: | bar |
:: | {} | :: | {} |
::foo | {} | :: | foo |
::foo:: | ::foo | ::foo:: | {} |
::foo::bar | ::foo | ::foo:: | bar |
::foo::bar:: | ::foo::bar | ::foo::bar:: | {} |
Arguments:
Argument | Type | Default value/ choices | Description |
name | variableorcommandname | (n/a) | Variable or procedure name |
Returns: the leading namespace qualifers for the given name.
::Simple::Namespace::qualify
name ?levels?Synopsis: qualifies a name up the calling stack.
Access mode: public.
Keywords: namespace, qualify and qualifier.
This procedure qualifies a variable or procedure name. It is somewhat similar to the auto_qualify
procedure but the namespace is taken from a scope up the calling stack. By default, one level up the stack is used.
Arguments:
Argument | Type | Default value/ choices | Description |
name | variableorcommandname | (n/a) | Variable or procedure name |
?levels? | integer | 1 | Levels up the stack in which to operate |
Returns: the qualified name.
Limitations:
This procedure must be called from another procedure. If the levels optional argument is specified, the corresponding number of levels up the stack are necessary.
The auto_qualify
procedure.
The ::Simple::Priv::qualify
procedure.
The ::Simple::Priv::qualify-split
procedure.