SimpleBase v1.0
The Simple Development Library base package
Project: the Simple Development Library.
::Simple::List::enumerate
list ?separator?::Simple::List::globs
?-negate? candidates patterns::Simple::cget
?-storemetadata?::Simple::configure
?-storemetadata extbool?::Simple::NO-OPTIONS
::Simple::NON-EXISTING
::Simple::NO-SUBCOMMAND
::Simple::BAD-SUBCOMMAND
::Simple::BAD-SUBCOMMAND-ARGS
::Simple::BAD-SUBCOMMAND-ARGS-EMPTY
::Simple::FLAG-REQUIRED
::Simple::AT-LEAST-ONE-FLAG
::Simple::BAD-FLAG
::Simple::DUPLICATED-FLAG-OR-OPTION
::Simple::BAD-VALUE
::Simple::TOO-MANY-ARGS
::Simple::TOO-MANY-ARGS-NO-CALL
::Simple::NO-VALUE-FOR-PARAM
::Simple::BAD-ITEM
::Simple::List::enumerate
list ?separator?::Simple::List::globs
?-negate? candidates patterns::Simple::cget
?-storemetadata?::Simple::configure
?-storemetadata extbool?Synopsis: the Simple Development Library base package.
This package contains the options applicable to The Simple Development Library as a whole as well as a few procedures for lists handling.
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.
Date | Reason |
22-jun-2005 | The Simple Development Library version 1.0 |
Copyright (C) 1999-2005, Juan C. Gil (jgil@gmv.es).
Paradigm: procedural.
Requisites: Tcl 8.1
.
None.
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.
::Simple
::Simple::Priv
::Simple::List
::Simple::List::enumerate
list ?separator?Synopsis: enumerates the elements of a list.
Details: see section 4.1.
::Simple::List::globs
?-negate? candidates patternsSynopsis: performs globbing based on candidates and pattern lists.
Details: see section 4.2.
::Simple::cget
?-storemetadata?Synopsis: gets The Simple Development Library package options.
Details: see section 4.3.
::Simple::configure
?-storemetadata extbool?Synopsis: configures The Simple Development Library options.
Details: see section 4.4.
::Simple::NO-OPTIONS
Message: package with no options.
Explanation: this package configure
command is not functional because the package has no options.
::Simple::NON-EXISTING
Message: non-existing item "name".
Explanation: the item named name does not exist.
::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.
::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.
::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.
::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.
::Simple::FLAG-REQUIRED
Message: flag flag or flags combination required.
Explanation: the flag or flags given in the flag or flags combination are required.
::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.
::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.
::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.
::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.
::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.
::Simple::TOO-MANY-ARGS-NO-CALL
Message: too many arguments.
Explanation: too many arguments were supplied.
Corrective action: use the correct list of arguments.
::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.
::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.
None.
::Simple::List::enumerate
list ?separator?Synopsis: enumerates the elements of a list.
Access mode: public.
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.
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.
::Simple::List::globs
?-negate? candidates patternsSynopsis: performs globbing based on candidates and pattern lists.
Access mode: public.
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.
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.
::Simple::cget
?-storemetadata?Synopsis: gets The Simple Development Library package options.
Access mode: public.
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.
::Simple::configure
?-storemetadata extbool?Synopsis: configures The Simple Development Library options.
Access mode: public.
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.