The chain Reference Manual

This is the chain Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Jul 13 18:45:42 2025 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 chain

Two chaining/piping macros, one of them ‘setf‘ing its first argument

Author

Thomas Bartscher <>

License

BSD-3

Version

0.0.1

Dependencies
  • metabang-bind (system).
  • mgl-pax (system).
Source

chain.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 chain/chain.asd

Source

chain.asd.

Parent Component

chain (system).

ASDF Systems

chain.


3.1.2 chain/package.lisp

Source

chain.asd.

Parent Component

chain (system).

Packages

chain.

Internals

@chain (special variable).


3.1.3 chain/chain.lisp

Dependency

package.lisp (file).

Source

chain.asd.

Parent Component

chain (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 chain

Source

package.lisp.

Use List
  • common-lisp.
  • metabang.bind.
  • mgl-pax.
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: => (argument &body body)

Thread a value through a series of transformations, where ‘%‘ represents the value of the last transformation.

- Arguments

+ ‘argument‘: Initial value or a ‘(:var SYMBOL INITIAL-VALUE)‘ binding form. + ‘body‘: Forms to apply sequentially. Each form has ‘%‘ bound as an anaphoric variable bound to the return value of the previous form in the body.
Each form may be:

* - A regular form
* - A ‘(:var SYMBOL EXPR)‘ form to bind ‘SYMBOL‘ to the result of evaluating ‘EXPR‘
* - A ‘(lambda (X) …)‘ form that is called on the result of the previous form.

- Return value

Returns the value of its last form.

- Examples

“‘lisp
;; Basic numeric pipeline
(=> 5
(* % 2) ; => 10
(1+ %))
=> 11

;; lambda form usage
(=> 5
(lambda (x) ; => 8
(+ x 3))
(* % 2))
=> 16

;; :var binding
(=> 5
(:var y (* % 3)) ; y = 15, % = 15
(1+ %) ; % = 16
(+ y %)) ; y + % = 15 + 16
=> 31

;; :var in argument position
(=> (:var a 5) ; a = 5, % = 5
(1+ %) ; % = 6
(+ a %)) ; a + % = 5 + 6
=> 11
“‘

Package

chain.

Source

chain.lisp.

Macro: set=> (argument &body body)

Thread the initial value of a place through transformations like in macro ‘=>‘, and update the place with the final result.

- Arguments

+ ‘argument‘: A ‘setf‘-able place or ‘(:var SYMBOL PLACE)‘ where SYMBOL is a variable name and PLACE is a ‘setf‘-able place. When refering to PLACE from here on out, the ‘setf‘-able place is meant.
+ ‘body‘: Exactly the same as in macro ‘=>‘. Supports ‘:var‘, ‘lambda‘ and ‘%‘ the same as ‘=>‘.

- Return value

Returns the value of its last form.

- Side effects

Updates PLACE to the calculated result.

- Examples

“‘lisp
;;; Modify a variable
(let ((x 5))
(set=> x
(* % 2) ; => 10
(1+ %)) ; => 11
x)
=> 11

;; Using :var
(defstruct box (value 0))
(let ((b (make-box :value 8)))
(set=> (:var v (box-value b))
(+ % 5) ; => 13
(* v %)) ; => 8 * 13 = 104
(box-value b))
=> 104
“‘

Package

chain.

Source

chain.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: @chain
Package

chain.

Source

package.lisp.


5.2.2 Macros

Macro: chop (var list &body body)
Package

chain.

Source

chain.lisp.


5.2.3 Ordinary functions

Function: expand-chain (argument forms)
Package

chain.

Source

chain.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions


A.3 Variables

Jump to:   @  
S  
Index Entry  Section

@
@chain: Private special variables

S
Special Variable, @chain: Private special variables