ccase-using |
| test keyplace
| [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) | |
keyplace | A form; evaluated to produce a | |
results | The values returned by evaluating the last form in the selected clause |
Returns
The values returned by the last form in the selected clause.
Errors
No clause was selected.
Detailed syntax
| ( keys form*) |
Terms
test-key | An object produced by evaluating | |
keys | An object or a proper list of objects. | |
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 keyplace is first evaluated to produce the
Each of the clauses is then considered in turn. If the
progn
If no clause is selected, a correctable error of type
case-using-failure
type-error
(member (union
keys
:test
test)
store-value
Ccase-using is a generalization of Common Lisp's ccase
See also
case-using-failure
case-using
ecase-using
Examples
> (defparameter *x* "a") *x* > (ccase-using string= *x* ("a" 1) (("b" "c" "d") 2)) 1 > (setf *x* "d") "d" > (ccase-using string= *x* ("a" 1) (("b" "c" "d") 2)) 2 > (setf *x* "C") "C" > (ccase-using string= *x* ("a" 1) (("b" "c" "d") 2)) Error: "C" fell through an ecase-using string= form; the valid keys are "a", "b", "c", and "d". Restart actions (select using :c n): 0: Supply a new value for *x*. >> :c 0 Enter a form to evaluate as the new value for *x*: "a" *x* is now "a" 1 >
The GBBopen Project
ccase-using |