The mcase Reference Manual

This is the mcase Reference Manual, version 1.2.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:16:00 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 mcase

Control frow macros with case comprehensiveness checking.

Author

SATO Shinichi

Source Control

(GIT git@github.com:hyotang666/mcase)

Bug Tracker

https://github.com/hyotang666/mcase/issues

License

Public domain

Version

1.2.1

Dependency

millet (system).

Source

mcase.asd.

Child Component

mcase.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 mcase/mcase.asd

Source

mcase.asd.

Parent Component

mcase (system).

ASDF Systems

mcase.


3.1.2 mcase/mcase.lisp

Source

mcase.asd.

Parent Component

mcase (system).

Packages

mcase.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 mcase

Source

mcase.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: emcase (type <target> &body clauses)

# 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
“‘

Package

mcase.

Source

mcase.lisp.

Macro: mcase (type <target> &body clauses)

# 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
“‘

Package

mcase.

Source

mcase.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: check-exhaust (type clauses)
Package

mcase.

Source

mcase.lisp.

Function: pprint-mcase (output exp)
Package

mcase.

Source

mcase.lisp.

Function: pprint-mcase-clause (output clause &rest noise)
Package

mcase.

Source

mcase.lisp.


Appendix A Indexes


A.1 Concepts


A.3 Variables