This section documents predefined CLIM presentation types, presentation type options, and parameters. For more information on how to use these presentation types, see 6.2 How to Specify a CLIM Presentation Type.
Note that any presentation type with the same name as a Common Lisp type accepts the same parameters as the Common Lisp type (and additional parameters in a few cases).
These basic presentation types correspond to the Common Lisp types of the same name.
Summary: The supertype of all other presentation types.
Summary: The subtype of all other presentation types. This has no printed representation, and is useful only in writing "context independent" translators, that is, translators whose to-type is nil
.
Summary: The presentation type that represents "nothing". The single object associated with this type is nil
, and its printed representation is None
.
Summary: The presentation type that represents t
or nil
. The textual representation is Yes
and No
respectively.
Summary: The presentation type that represents a symbol.
Summary: The presentation type that represents a symbol in the keyword package. It is a subtype of symbol.
Summary: The type that represents all the places in a window where there is no presentation that is applicable in the current input context. CLIM provides a single "null presentation" as the object associated with this type.
Summary: The null presentation, which occupies all parts of a window in which there are no applicable presentations. This will have a presentation type of blank-area.
The following presentation types represent the Common Lisp numeric types of the same name.
Summary: The presentation type that represents a general number. It is the supertype of all the number types described here.
Summary: The presentation type that represents a complex number.
rational &optional low high
Summary: The presentation type that represents either a ratio or an integer between low and high. Options to this type are base and radix, which are the same as for the integer type.
integer &optional low high
Summary: The presentation type that represents an integer between low and high. Options to this type are base (default 10
) and radix (default nil
), which correspond to *print-base* and *print-radix*, respectively. It is a subtype of rational.
ratio &optional low high.
The presentation type that represents a ratio between low and high. Options to this type are base and radix, which are the same as for the integer type. It is a subtype of rational.
float &optional low high.
The presentation type that represents a floating point number between low and high.
These two presentation types can be used for reading and writing characters and strings.
Summary: The presentation type that represents a Common Lisp character object.
string &optional length
Summary: The presentation type that represents a string. If length is specified, the string must have exactly that many characters.
Summary: The presentation type that represents a pathname.
The options are default-version, which defaults to :newest
, default-type, which defaults to nil
, and merge-default, which defaults to t
. If merge-default is nil
, accept returns the exact pathname that was entered; otherwise, accept merges against the default and default-version. If no default is supplied, it defaults to *default-pathname-defaults*. pathname has a default preprocessor that merges the options into the default.
The "one-of" and "some-of" presentation types can be used to accept and present one or more items from a set of items. The set of items can be specified as a "rest" argument, a sequence, or an alist.
This table summarizes single ("one-of") and multiple ("some-of") selection presentation types. Each row represents a type of presentation. Columns contain the associated single and multiple selection presentation types.
completion sequence &key test value-key
Summary: The presentation type that selects one from a finite set of possibilities, with "completion" of partial inputs. Several types are implemented in terms of the completion
type, including token-or-type, null-or-type, member, member-sequence, and member-alist.
sequence is a list or vector whose elements are the possibilities. Each possibility has a printed representation, called its name, and an internal representation, called its value. accept reads a name and returns a value. present is given a value and outputs a name.
test is a function that compares two values for equality. The default is eql.
value-key is a function that returns a value, given an element of sequence. The default is identity.
The following presentation type options are available:
string |
Returns the string. |
null |
Returns "nil" . |
cons |
Returns string of the car. |
symbol |
Returns string-capitalize of its name. |
otherwise |
Returns princ-to-string of it. |
nil
or a descriptive string, given an element of sequence. The default always returns nil
.#\Space
.
member Presentation Abbreviation
member &rest elements
Summary: The presentation type that specifies one of elements. The options are the same as for completion.
member-sequence Presentation Abbreviation
member-sequence sequence &key test
Summary: Like member, except that the set of possibilities is the sequence sequence. The parameter test and the options are the same as for completion.
member-alist Presentation Abbreviation
member-alist alist &key test
Summary: Like member, except that the set of possibilities is the alist alist. Each element of alist is either an atom, as in member-sequence, or a list whose car is the name of that possibility and whose cdr is one of the following:
:value |
The value. |
:documentation |
A descriptive string. |
The test parameter and the options are the same as for completion except that value-key and documentation-key default to functions that support the specified alist format.
subset-completion Presentation Type
subset-completion sequence &key test value-key
Summary: The type that selects one or more from a finite set of possibilities, with "completion" of partial inputs. The parameters and options are the same as for completion, plus the additional options separator and echo-space, which are as for the sequence type. The subset types that follow are implemented in terms of the subset-completion
type.
subset Presentation Abbreviation
subset &rest elements
Summary: The presentation type that specifies a subset of elements. Values of this type are lists of zero or more values chosen from the possibilities in elements. The printed representation is the names of the elements separated by commas. The options are the same as for completion.
subset-sequence Presentation Abbreviation
subset-sequence sequence &key test
Summary: Like subset, except that the set of possibilities is the sequence sequence. The parameter test and the options are the same as for completion.
subset-alist Presentation Abbreviation
subset-alist alist &key test
Summary: Like subset, except that the set of possibilities is the alist alist.
The following two presentation types can be used to accept and present a sequence of objects.
sequence type
Summary: The presentation type that represents a sequence of elements of type type. type can be a presentation type abbreviation. The printed representation of a sequence type is the elements separated by commas. accept returns a list.
The options to this type are separator and echo-space. separator is used to specify a character that will act as the separator between elements of the sequence; the default is the comma character #\,
. echo-space is t
or nil
; when it is t
(the default) a space will be automatically inserted into the input buffer when the user types a separator character.
sequence-enumerated Presentation Type
sequence-enumerated &rest types
Summary: sequence-enumerated
is like sequence, except that the type of each element in the sequence is individually specified.The elements of types can be presentation type abbreviations. accept returns a list.
The options to this type are separator and echo-space, which are as for the sequence type.
or &rest types
Summary: The presentation type that is used to specify one of several types, for example, (or (member :all :none) integer).
The elements of types can be presentation type abbreviations. accept returns one of the possible types as its second value, not the original or
presentation type specifier.
and &rest types
Summary: The type that is used for "multiple inheritance." and
is frequently used in conjunction with satisfies, for example: (and integer (satisfies oddp))
. The elements of types can be presentation type abbreviations.
The and
type has special syntax that supports the two "predicates," satisfies and not. satisfies and not cannot stand alone as presentation types and cannot be first in types. not can surround either satisfies or a presentation type.
The first type in types is the type whose methods will be used during calls to accept and present.
The following compound presentation types are provided because they implement some common idioms.
token-or-type Presentation Abbreviation
token-or-type tokens type
Summary: A compound type that is used to select one of a set of special tokens, or an object of type type. tokens is anything that can be used as the sequence parameter to member-alist; typically it is a list of symbols.
null-or-type Presentation Abbreviation
null-or-type type
Summary: A compound type that is used to select nil
, whose printed representation is the special token "None," or an object of type type.
type-or-string Presentation Abbreviation
type-or-string type
Summary: A compound type that is used to select an object of type type or an arbitrary string, for example: (clim:type-or-string integer)
. Any input that accept cannot parse as the representation of an object of type type is returned as a string.
The command and form presentation types are complex types provided primarily for use by the top-level interactor of an application.
Summary: The presentation type used to represent any Lisp object. The textual view of this type looks like what the standard print and read functions produce and accept. The standard print and read functions produce and accept the textual view of this type.
A separate presentation history for each instance of an application frame is maintained for the expression
presentation type.
Summary: The presentation type used to represent a Lisp form. This is a subtype of expression and is equivalent to it, except that some presentation translators produce quote forms.
command &key command-table
Summary: The presentation type used to represent a command processor command and its arguments.
A separate presentation history for each instance of an application frame is maintained for the command
presentation type.
command-name Presentation Type
command-name &key command-table
Summary: The presentation type used to represent the name of a command processor command in the command table command-table.
command-or-form Presentation Type
command-or-form &key command-table
Summary: The presentation type used to represent either a Lisp form or a command processor command and its arguments.
CLIM 2.0 User Guide - 01 Dec 2021 19:38:57