The arrows Reference Manual

This is the arrows Reference Manual, version 0.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 04:17:33 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 arrows

Implements -> and ->> from Clojure, as well as several expansions on the idea.

Author

Svante von Erichsen <>

License

CC0

Version

0.2.0

Source

arrows.asd.

Child Component

arrows.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 arrows/arrows.asd

Source

arrows.asd.

Parent Component

arrows (system).

ASDF Systems

arrows.


3.1.2 arrows/arrows.lisp

Source

arrows.asd.

Parent Component

arrows (system).

Packages

arrows.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 arrows

Source

arrows.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: -<> (initial-form &rest forms)

Like ->, but if a form in FORMS has one or more symbols named <> as top-level element, each such symbol is substituted by the primary result of the form accumulated so far, instead of it being inserted as first argument. Also known as diamond wand.

Package

arrows.

Source

arrows.lisp.

Macro: -<>> (initial-form &rest forms)

Like -<>, but if a form has no symbol named <>, the insertion is done at the end like in ->>. Also known as diamond spear.

Package

arrows.

Source

arrows.lisp.

Macro: -> (initial-form &rest forms)

Inserts INITIAL-FORM as first argument into the first of FORMS, the result into the next, etc., before evaluation. FORMS are treated as list designators.

Package

arrows.

Source

arrows.lisp.

Macro: ->* (&rest forms)

Like ->, but the last form is used as initial form, then the remaining forms used as in ->. This is intended for inversing the default in a ->> form.

Example:

(->> 3
(/ 12)
(->* (/ 2)))
=> 2

Package

arrows.

Source

arrows.lisp.

Macro: ->> (initial-form &rest forms)

Like ->, but the forms are inserted as last argument instead of first.

Package

arrows.

Source

arrows.lisp.

Macro: as-> (initial-form var &rest forms)

Binds INITIAL-FORM to VAR, then successively each of FORMS to VAR, finally returns the last value of VAR.

Package

arrows.

Source

arrows.lisp.

Macro: as->* (var &rest forms)

Shorthand for the combination of ->* and as->: the last form is used for initial binding, then the remaining forms used as in as->. This is intended for overriding the default in a ->> form.

Package

arrows.

Source

arrows.lisp.

Macro: cond-> (initial-form &rest clauses)

CLAUSES is a list of clauses similar to COND clauses, each clause comprising first a test form, then a body of further forms. Cond-> evaluates INITIAL-FORM to a value, then for each clause whose test evaluates to true, pipes (as in ->) the value through each form in the body of the clause. Note that unlike in COND, there is no short-circuiting: each clause gets tested regardless of the outcome of the clauses before.

Package

arrows.

Source

arrows.lisp.

Macro: cond->> (initial-form &rest clauses)

Like cond->, but with insertion behaviour as in ->>.

Package

arrows.

Source

arrows.lisp.

Macro: some-> (initial-form &rest forms)

Like ->, but short-circuits to nil as soon as either INITIAL-FORM or any of FORMS return nil. This is like all these forms are lifted to the maybe monad.

Package

arrows.

Source

arrows.lisp.

Macro: some->> (initial-form &rest forms)

Like some->, but with insertion behaviour as in ->>.

Package

arrows.

Source

arrows.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: <>p (form)

Predicate identifying the placeholders for the -<> and -<>> macros.

Package

arrows.

Source

arrows.lisp.

Function: cond-inserter (insert-fun)
Package

arrows.

Source

arrows.lisp.

Function: diamond-inserter (insert-fun)
Package

arrows.

Source

arrows.lisp.

Function: expand-arrow (initial-form forms insert-fun)
Package

arrows.

Source

arrows.lisp.

Function: expand-cond (initial-form clauses insert-fun)
Package

arrows.

Source

arrows.lisp.

Function: expand-some (initial-form forms insert-fun)
Package

arrows.

Source

arrows.lisp.

Function: insert-first (arg surround)

Inserts ARG into the list form SURROUND as its first argument, after the operator.

Package

arrows.

Source

arrows.lisp.

Function: insert-last (arg surround)

Inserts ARG into the list form SURROUND as its last argument.

Package

arrows.

Source

arrows.lisp.

Function: simple-inserter (insert-fun)
Package

arrows.

Source

arrows.lisp.

Function: some-inserter (insert-fun)
Package

arrows.

Source

arrows.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   -   <  
A   C   D   E   F   I   M   S  
Index Entry  Section

-
-<>: Public macros
-<>>: Public macros
->: Public macros
->*: Public macros
->>: Public macros

<
<>p: Private ordinary functions

A
as->: Public macros
as->*: Public macros

C
cond->: Public macros
cond->>: Public macros
cond-inserter: Private ordinary functions

D
diamond-inserter: Private ordinary functions

E
expand-arrow: Private ordinary functions
expand-cond: Private ordinary functions
expand-some: Private ordinary functions

F
Function, <>p: Private ordinary functions
Function, cond-inserter: Private ordinary functions
Function, diamond-inserter: Private ordinary functions
Function, expand-arrow: Private ordinary functions
Function, expand-cond: Private ordinary functions
Function, expand-some: Private ordinary functions
Function, insert-first: Private ordinary functions
Function, insert-last: Private ordinary functions
Function, simple-inserter: Private ordinary functions
Function, some-inserter: Private ordinary functions

I
insert-first: Private ordinary functions
insert-last: Private ordinary functions

M
Macro, -<>: Public macros
Macro, -<>>: Public macros
Macro, ->: Public macros
Macro, ->*: Public macros
Macro, ->>: Public macros
Macro, as->: Public macros
Macro, as->*: Public macros
Macro, cond->: Public macros
Macro, cond->>: Public macros
Macro, some->: Public macros
Macro, some->>: Public macros

S
simple-inserter: Private ordinary functions
some->: Public macros
some->>: Public macros
some-inserter: Private ordinary functions


A.3 Variables