This is the mcase Reference Manual, version 1.2.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:59:17 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
mcase
Control frow macros with case comprehensiveness checking.
SATO Shinichi
(GIT git@github.com:hyotang666/mcase)
Public domain
1.2.1
millet
(system).
mcase.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
mcase/mcase.lisp
mcase
(system).
check-exhaust
(function).
pprint-mcase
(function).
pprint-mcase-clause
(function).
Packages are listed by definition order.
mcase
common-lisp
.
check-exhaust
(function).
pprint-mcase
(function).
pprint-mcase-clause
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
# EMCASE
## Description:
A thin wrapper for CL:ECASE to check MEMBER comprehensiveness in macro expansion time.
### syntax (EMCASE type <target> &body clauses)
=> result
type := type-specifer, otherwise implementation dependent condition.
“‘lisp
#?(emcase "not type specifier" :dummy)
:signals condition
, :lazy
“‘
<target> := Expression to generate target value.
clause* := Same with CL:ECASE.
result := T.
## Affected By:
none
## Side-Effects:
none
## Notes:
## Exceptional-Situations:
When type specifier is not expanded to (MEMBER ...) an error is signaled.
“‘lisp
#?(emcase (unsigned-byte 8) :dummy)
:signals error
, :lazy
“‘
## Examples:
“‘lisp
#?(emcase state :dummy (:a "Missing :b and :c members"))
:signals error
, :lazy
“‘
“‘lisp
#?(emcase state :dummy ((:a :b :c) "Works fine."))
:signals error
“‘
“‘lisp
#?(emcase state :dummy
((:a :b :c) "Fine but")
(:d "Ooops! Unknown member is found!"))
:signals error
, :lazy
“‘
# MCASE
## Description:
A thin wrapper for CL:CASE to check MEMBER comprehensiveness in macro expansion time.
### syntax (MCASE type <target> &body clause\*)
=> result
## Arguments and Values:
type := type-specifer, otherwise implementation dependent condition.
“‘lisp
#?(mcase "not type specifier" :dummy)
:signals condition
, :lazy
“‘
<target> := Expression to generate target value.
clause* := Same with CL:CASE.
result := T.
## Affected By:
none
## Side-Effects:
none
## Notes:
## Exceptional-Situations:
When type specifier is not expanded to (MEMBER ...) an error is signaled.
“‘lisp
#?(mcase (unsigned-byte 8) :dummy)
:signals error
, :lazy
“‘
Ordinary otherwise clause is invalid because in such case you should use CASE.
“‘lisp
#?(mcase (member 0 1 2) :dummy
((0 1 2) :yes)
(otherwise :no))
:signals error
, :lazy
“‘
One exceptional situation is OTHERWISE in the MEMBER.
“‘lisp
#?(mcase (member 0 1 2 otherwise) :dummy
((0 1 2) :yes)
(otherwise :no))
=> :NO
“‘
## Examples:
“‘lisp
#?(deftype state () ’(member :a :b :c))
=> STATE
“‘
“‘lisp
#?(mcase state :dummy (:a "Missing :b and :c members"))
:signals error
, :lazy
“‘
“‘lisp
#?(mcase state :dummy ((:a :b :c) "Works fine."))
=> NIL
“‘
“‘lisp
#?(mcase state :dummy
((:a :b :c) "Fine but")
(:d "Ooops! Unknown member is found!"))
:signals error
, :lazy
“‘
Jump to: | C E F M P |
---|
Jump to: | C E F M P |
---|
Jump to: | F M P S |
---|
Jump to: | F M P S |
---|