The mcase Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The mcase Reference Manual

This is the mcase Reference Manual, version 1.2.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 05:31:53 2022 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

MCASE 0.0.0

What is this?

Control frow macros with case comprehensiveness checking.

Usage

* (deftype state ()
    '(member :a :b :c))
STATE

* (mcase:mcase state :hoge
    (:a "A")
    (:b "B"))
=> ERROR Missing member (:C) :of STATE

For details, see spec file.

From developer

Product's goal

License

Public domain.

Developed with

SBCL

Tested with

Installation


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 mcase

Author

SATO Shinichi

Source Control

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

Bug Tracker

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

License

Public domain

Description

Control frow macros with case comprehensiveness checking.

Version

1.2.1

Dependency

millet

Source

mcase.asd (file)

Component

mcase.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 mcase.asd

Location

/home/quickref/quicklisp/dists/quicklisp/software/mcase-20211020-git/mcase.asd

Systems

mcase (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 mcase/mcase.lisp

Parent

mcase (system)

Location

mcase.lisp

Packages

mcase

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 mcase

Source

mcase.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

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 (file)

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 (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: check-exhaust TYPE CLAUSES
Package

mcase

Source

mcase.lisp (file)

Function: pprint-mcase OUTPUT EXP
Package

mcase

Source

mcase.lisp (file)

Function: pprint-mcase-clause OUTPUT CLAUSE &rest NOISE
Package

mcase

Source

mcase.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M  
Index Entry  Section

F
File, Lisp, mcase.asd: The mcase․asd file
File, Lisp, mcase/mcase.lisp: The mcase/mcase․lisp file

L
Lisp File, mcase.asd: The mcase․asd file
Lisp File, mcase/mcase.lisp: The mcase/mcase․lisp file

M
mcase.asd: The mcase․asd file
mcase/mcase.lisp: The mcase/mcase․lisp file

Jump to:   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   E   F   M   P  
Index Entry  Section

C
check-exhaust: Internal functions

E
emcase: Exported macros

F
Function, check-exhaust: Internal functions
Function, pprint-mcase: Internal functions
Function, pprint-mcase-clause: Internal functions

M
Macro, emcase: Exported macros
Macro, mcase: Exported macros
mcase: Exported macros

P
pprint-mcase: Internal functions
pprint-mcase-clause: Internal functions

Jump to:   C   E   F   M   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   M   P   S  
Index Entry  Section

M
mcase: The mcase system
mcase: The mcase package

P
Package, mcase: The mcase package

S
System, mcase: The mcase system

Jump to:   M   P   S