SimpleBase v1.0 

 The Simple Development Library base package 

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.2.1 -storemetadata
   2.3 Namespaces
   2.4 Commands
      2.4.1 ::Simple::List::enumerate list ?separator?
      2.4.2 ::Simple::List::globs ?-negate? candidates patterns
      2.4.3 ::Simple::cget ?-storemetadata?
      2.4.4 ::Simple::configure ?-storemetadata extbool?
   2.5 Errors
      2.5.1 ::Simple::NO-OPTIONS
      2.5.2 ::Simple::NON-EXISTING
      2.5.3 ::Simple::NO-SUBCOMMAND
      2.5.4 ::Simple::BAD-SUBCOMMAND
      2.5.5 ::Simple::BAD-SUBCOMMAND-ARGS
      2.5.6 ::Simple::BAD-SUBCOMMAND-ARGS-EMPTY
      2.5.7 ::Simple::FLAG-REQUIRED
      2.5.8 ::Simple::AT-LEAST-ONE-FLAG
      2.5.9 ::Simple::BAD-FLAG
      2.5.10 ::Simple::DUPLICATED-FLAG-OR-OPTION
      2.5.11 ::Simple::BAD-VALUE
      2.5.12 ::Simple::TOO-MANY-ARGS
      2.5.13 ::Simple::TOO-MANY-ARGS-NO-CALL
      2.5.14 ::Simple::NO-VALUE-FOR-PARAM
      2.5.15 ::Simple::BAD-ITEM
3. Package further information
4. Package command details
   4.1 ::Simple::List::enumerate list ?separator?
      4.1.1 Command description
         4.1.1.1 Overview
      4.1.2 Command public API
   4.2 ::Simple::List::globs ?-negate? candidates patterns
      4.2.1 Command description
         4.2.1.1 Overview
      4.2.2 Command public API
   4.3 ::Simple::cget ?-storemetadata?
      4.3.1 Command description
      4.3.2 Command public API
   4.4 ::Simple::configure ?-storemetadata extbool?
      4.4.1 Command description
      4.4.2 Command public API

1. Package description

Synopsis: the Simple Development Library base package.

1.1 Overview

This package contains the options applicable to The Simple Development Library as a whole as well as a few procedures for lists handling.

1.2 Usage

The ::Simple::List::enumerate procedure enumerates the elements of a list while ::Simple::List::globs returns the elements in a list which match at least one (or do not match any) pattern among those in another list.

1.3 History

Date Reason
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: Tcl 8.1.

2.1 Types

None.

2.2 Options

2.2.1 -storemetadata

Type: boolean.

Value: 0.

Description: whether non-essential details (metadata) of most items declared with The Simple Development Library (errors, packages, types, procedures, classes, ...) are stored or not.

While not storing the metadata saves some memory, the information returned by the various information commands may be incomplete. Notice that only those items created after modyfing this option are affected by the change. Notice also that items within packages declared via declare-package are only created upon installing the package.

2.3 Namespaces

  1. ::Simple

  2. ::Simple::Priv

  3. ::Simple::List

2.4 Commands

2.4.1 ::Simple::List::enumerate list ?separator?

Synopsis: enumerates the elements of a list.

Details: see section 4.1.

2.4.2 ::Simple::List::globs ?-negate? candidates patterns

Synopsis: performs globbing based on candidates and pattern lists.

Details: see section 4.2.

2.4.3 ::Simple::cget ?-storemetadata?

Synopsis: gets The Simple Development Library package options.

Details: see section 4.3.

2.4.4 ::Simple::configure ?-storemetadata extbool?

Synopsis: configures The Simple Development Library options.

Details: see section 4.4.

2.5 Errors

2.5.1 ::Simple::NO-OPTIONS

Message: package with no options.

Explanation: this package configure command is not functional because the package has no options.

2.5.2 ::Simple::NON-EXISTING

Message: non-existing item "name".

Explanation: the item named name does not exist.

2.5.3 ::Simple::NO-SUBCOMMAND

Message: wrong # args: should be "command option ?arg ...?".

Explanation: the base command command has been invoked with no subcommand.

Corrective action: invoke the base command giving a subcommand.

2.5.4 ::Simple::BAD-SUBCOMMAND

Message: bad option "subcommand": must be list of allowed subcommands.

Explanation: subcommand subcommand is not in the list of allowed subcommands for the base command.

Corrective action: invoke the base command giving a subcommand among those in the list.

2.5.5 ::Simple::BAD-SUBCOMMAND-ARGS

Message: wrong # args: should be "subcommand procedure argument list".

Explanation: subcommand procedure subcommand procedure has been invoked with a bad argument list.

Corrective action: invoke the subcommand procedure matching the argument list.

2.5.6 ::Simple::BAD-SUBCOMMAND-ARGS-EMPTY

Message: wrong # args: should be "subcommand procedure".

Explanation: subcommand procedure subcommand procedure has been invoked with a bad argument list.

Corrective action: invoke the subcommand procedure without arguments.

2.5.7 ::Simple::FLAG-REQUIRED

Message: flag flag or flags combination required.

Explanation: the flag or flags given in the flag or flags combination are required.

2.5.8 ::Simple::AT-LEAST-ONE-FLAG

Message: at least one flag required, flags are list of flags.

Explanation: no flag was supplied.

Corrective action: supply a flag from the list of flags.

2.5.9 ::Simple::BAD-FLAG

Message: bad flag "flag": must be list of flags.

Explanation: flag flag is not in the list of flags.

Corrective action: supply a flag among those in the list.

2.5.10 ::Simple::DUPLICATED-FLAG-OR-OPTION

Message: duplicated flag or option flag or option.

Explanation: the flag or option flag or option has been given twice.

2.5.11 ::Simple::BAD-VALUE

Message: invalid value "value" for variable, array element or argument "variable, array element or argument name" of type "type"[: further explanation].

Explanation: a variable, array element or argument value did not conform to its type.

Corrective action: either modify the variable, array element or argument value or type.

2.5.12 ::Simple::TOO-MANY-ARGS

Message: called "command" with too many arguments.

Explanation: a call to the command command failed because too many arguments were supplied.

Corrective action: use the correct list of arguments.

2.5.13 ::Simple::TOO-MANY-ARGS-NO-CALL

Message: too many arguments.

Explanation: too many arguments were supplied.

Corrective action: use the correct list of arguments.

2.5.14 ::Simple::NO-VALUE-FOR-PARAM

Message: no value given for parameter "argument" to "procedure".

Explanation: a call to the procedure procedure failed because no value was supplied for argument argument.

Corrective action: use the correct list of arguments.

2.5.15 ::Simple::BAD-ITEM

Message: expected item but got "bad item".

Explanation: bad item was found when an item was expected.

Corrective action: provide a valid item.

3. Package further information

None.

4. Package command details

4.1 ::Simple::List::enumerate list ?separator?

4.1.1 Command description

Synopsis: enumerates the elements of a list.

Access mode: public.

4.1.1.1 Overview

This procedure returns a string built by separating the input list elements with commas except the last one which is preceded by the separator argument which defaults to "or". If the number of elements in the list is lower than two the list is returned unmodified.

4.1.2 Command public API

Arguments:

Argument Type Default value/ choices Description
list list (n/a) List
?separator? string or Modifier for last item

Returns: the enumerated list as a string.

4.2 ::Simple::List::globs ?-negate? candidates patterns

4.2.1 Command description

Synopsis: performs globbing based on candidates and pattern lists.

Access mode: public.

4.2.1.1 Overview

This procedure returns the elements in a list of candidates matching at least one pattern among those in another list, or those which do not match any pattern if the -negate flag is given.

4.2.2 Command public API

Arguments:

Argument Type Default value/ choices Description
-negate boolflag (n/a) Whether to negate the answer
candidates any-list (n/a) List of candidates
patterns pattern-list (n/a) List of patterns

Returns: the list of matching (or not matching) candidates.

4.3 ::Simple::cget ?-storemetadata?

4.3.1 Command description

Synopsis: gets The Simple Development Library package options.

Access mode: public.

4.3.2 Command public API

Arguments:

Argument Type Default value/ choices Description
-storemetadata boolflag (n/a) Gets whether non-essential details (metadata) of most items declared with The Simple Development Library (errors, packages, types, procedures, classes, ...) are stored or not

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

4.4 ::Simple::configure ?-storemetadata extbool?

4.4.1 Command description

Synopsis: configures The Simple Development Library options.

Access mode: public.

4.4.2 Command public API

Arguments: (flag parsing disabled)

Argument Type Default value/ choices Description
?-storemetadata? extbool false Whether non-essential details (metadata) of most items declared with The Simple Development Library (errors, packages, types, procedures, classes, ...) are stored or not

Returns: the empty string.