The with-branching Reference Manual

This is the with-branching Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 18:17:30 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 with-branching

An implementation of macroexpand-time conditionalization

Author

Michał "phoe" Herda <>

License

MIT

Version

0.0.1

Dependencies
  • alexandria (system).
  • trivial-indent (system).
Source

with-branching.asd.

Child Component

with-branching.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 with-branching/with-branching.asd

Source

with-branching.asd.

Parent Component

with-branching (system).

ASDF Systems

with-branching.


3.1.2 with-branching/with-branching.lisp

Source

with-branching.asd.

Parent Component

with-branching (system).

Packages

with-branching.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 with-branching

Source

with-branching.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 Special variables

Special Variable: *branch-bypass*

Bypasses macroexpand-time branching. The bypass inhibits all macroexpand-time branching and instead defers all checks in expanded code to runtime in the following manner:

* WITH-BRANCHING -> PROGN
* BRANCH-IF -> IF
* BRANCH-WHEN -> WHEN
* BRANCH-UNLESS -> UNLESS

Package

with-branching.

Source

with-branching.lisp.


5.1.2 Macros

Macro: branch-if (branch then &optional else)

Chooses between the forms to include based on whether a macroexpand-time branch is true. The first argument must be a symbol naming a branch in the lexically enclosing WITH-BRANCHING form.

It is an error to use this macro outside the lexical environment established by WITH-BRANCHES.

Package

with-branching.

Source

with-branching.lisp.

Macro: branch-unless (branch &body body)

Includes some forms based on whether a macroexpand-time branch is false. The first argument must be a symbol naming a branch in the lexically enclosing WITH-BRANCHING form.

It is an error to use this macro outside the lexical environment established by WITH-BRANCHES.

Package

with-branching.

Source

with-branching.lisp.

Macro: branch-when (branch &body body)

Includes some forms based on whether a macroexpand-time branch is true. The first argument must be a symbol naming a branch in the lexically enclosing WITH-BRANCHING form.

It is an error to use this macro outside the lexical environment established by WITH-BRANCHES.

Package

with-branching.

Source

with-branching.lisp.

Macro: with-branching ((&rest branches) &body body)

Establishes a lexical environment in which it is possible to use macroexpand-time branching. Within the lexical scope of
WITH-BRANCHING, it is possible to use BRANCH-IF,
BRANCH-WHEN, and BRANCH-UNLESS to conditionalize whether
some forms are included at compilation time.

The first argument must be a list of symbols which name variables. This macro will expand into a series of conditionals

Package

with-branching.

Source

with-branching.lisp.


5.2 Internals


5.2.1 Symbol macros

Symbol Macro: %all-branches%
Package

with-branching.

Source

with-branching.lisp.

Symbol Macro: %in-branching%
Package

with-branching.

Source

with-branching.lisp.


5.2.2 Macros

Macro: %with-branching ((&rest branches) &body body)
Package

with-branching.

Source

with-branching.lisp.


5.2.3 Ordinary functions

Function: conditional-error (name)
Package

with-branching.

Source

with-branching.lisp.

Function: missing-branch (name)
Package

with-branching.

Source

with-branching.lisp.


Appendix A Indexes


A.1 Concepts