SimpleNamespace v1.0 

 The Simple Development Library namespaces and qualified names handling 

Project: the Simple Development Library.

Table of contents

1. Package description
   1.1 Overview
   1.2 Usage
   1.3 History
   1.4 Copyright
2. Package public API
   2.1 Types
   2.2 Options
   2.3 Namespaces
   2.4 Commands
      2.4.1 ::Simple::Namespace::cget
      2.4.2 ::Simple::Namespace::configure
      2.4.3 ::Simple::Namespace::information exists namespace
      2.4.4 ::Simple::Namespace::qualifiers name
      2.4.5 ::Simple::Namespace::qualify name ?levels?
   2.5 Errors
3. Package further information
4. Package command details
   4.1 ::Simple::Namespace::cget
      4.1.1 Command description
      4.1.2 Command public API
   4.2 ::Simple::Namespace::configure
      4.2.1 Command description
      4.2.2 Command public API
   4.3 ::Simple::Namespace::information exists namespace
      4.3.1 Command description
      4.3.2 Command public API
   4.4 ::Simple::Namespace::qualifiers name
      4.4.1 Command description
         4.4.1.1 Overview
      4.4.2 Command public API
   4.5 ::Simple::Namespace::qualify name ?levels?
      4.5.1 Command description
         4.5.1.1 Overview
      4.5.2 Command public API
      4.5.3 Command further information
         4.5.3.1 References

1. Package description

Synopsis: the Simple Development Library namespaces and qualified names handling.

Keywords: namespace, qualify and qualifiers.

1.1 Overview

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.

1.2 Usage

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.

1.3 History

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

1.4 Copyright

Copyright (C) 1999-2005, Juan C. Gil (jgil@gmv.es).

2. Package public API

Paradigm: procedural.

Requisites: SimplePackage 1.0.

2.1 Types

None.

2.2 Options

None.

2.3 Namespaces

  1. ::Simple::Namespace

  2. ::Simple::Namespace::Priv

2.4 Commands

2.4.1 ::Simple::Namespace::cget

Synopsis: gets the package options.

Details: see section 4.1.

2.4.2 ::Simple::Namespace::configure

Synopsis: configures the package options.

Details: see section 4.2.

2.4.3 ::Simple::Namespace::information exists namespace

Synopsis: returns whether a namespace exists.

Details: see section 4.3.

2.4.4 ::Simple::Namespace::qualifiers name

Synopsis: returns leading namespace qualifiers.

Details: see section 4.4.

2.4.5 ::Simple::Namespace::qualify name ?levels?

Synopsis: qualifies a name up the calling stack.

Details: see section 4.5.

2.5 Errors

None.

3. Package further information

None.

4. Package command details

4.1 ::Simple::Namespace::cget

4.1.1 Command description

Synopsis: gets the package options.

Access mode: public.

4.1.2 Command public API

Arguments: none.

Returns: the requested option value or the whole list of options if none specified.

4.2 ::Simple::Namespace::configure

4.2.1 Command description

Synopsis: configures the package options.

Access mode: public.

4.2.2 Command public API

Arguments: none.

Returns: the "package with no options" error is thrown.

4.3 ::Simple::Namespace::information exists namespace

4.3.1 Command description

Synopsis: returns whether a namespace exists.

Access mode: public.

4.3.2 Command public API

Arguments:

Argument Type Default value/ choices Description
namespace namespace (n/a) Namespace

Returns: whether the namespace exists.

4.4 ::Simple::Namespace::qualifiers name

4.4.1 Command description

Synopsis: returns leading namespace qualifiers.

Access mode: public.

Keywords: namespace, qualify and qualifier.

4.4.1.1 Overview

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:: {}

4.4.2 Command public API

Arguments:

Argument Type Default value/ choices Description
name variableorcommandname (n/a) Variable or procedure name

Returns: the leading namespace qualifers for the given name.

4.5 ::Simple::Namespace::qualify name ?levels?

4.5.1 Command description

Synopsis: qualifies a name up the calling stack.

Access mode: public.

Keywords: namespace, qualify and qualifier.

4.5.1.1 Overview

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.

4.5.2 Command public API

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:

4.5.3 Command further information

4.5.3.1 References