![]() | ![]() | ![]() | case-using | ![]() |
|
| test keyform
nil | [Macro] |
Purpose
Conditionally execute the forms in a clause that is selected by
matching the result of evaluating
Package :gbbopen-tools
Module :gbbopen-tools
Arguments and values
| test | A symbol designating a comparison predicate (not evaluated) | |
| keyform | A form; evaluated to produce a | |
| results | The values returned by evaluating the last form in the
selected clause or nil
|
Returns
The values returned by the last form in the matching
nil.
Detailed syntax
|
| (keys form*) |
({otherwise | t} form*) | |
Terms
| test-key | An object produced by evaluating | |
| keys | An object or a proper list of objects. To refer to the symbols
t and otherwise(t) and (otherwise) | |
| form | A form |
Description
The specified test symbol is not evaluated; however the comparison
predicate that it designates must be available during expansion of the
The keyform is first evaluated to produce the
Each of the progn
Case-using is a generalization of Common Lisp's case macro.
See also
ccase-using
ecase-using
Examples
> (case-using string= "a"
("a" 1)
(("b" "c" "d") 2))
1
> (case-using string= "d"
("a" 1)
(("b" "c" "d") 2))
2
> (case-using string= "C"
("a" 1)
(("b" "c" "d") 2))
nil
> (case-using string= "C"
("a" 1)
(("b" "c" "d") 2)
(otherwise -1))
-1
> (case-using equalp "C"
("a" 1)
(("b" "c" "d") 2)
(otherwise -1))
2
>
The GBBopen Project
![]() | ![]() | ![]() | case-using | ![]() |