Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the binding-arrows Reference Manual, version 1.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 11:47:25 2020 GMT+0.
• Introduction | What binding-arrows is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
An implementation of threading macros based on binding anonymous variables.
This system implements binding threading macros - a kind of threading macros with different semantics than classical, Clojure core threading macros or their extension, swiss-arrows. Two Common Lisp implementations of those are arrows and arrow-macros.
This system is a fork of arrows with changes in semantics that make it impossible to merge back upstream.
A binding threading macro implicitly binds a variable on each computation step, as opposed to working purely on the syntactic level like the classical threading macros.
This has three main implications:
let*
form.
setf
expansions are handled by explicit setf
expanders for each macro.(-> foo (defun (bar) (1+ bar)))
is going to expand into a correct defun
form on a traditional threading macro implementation, but will fail on a binding implementation (e.g. this one).(->> (loop) (or t))
is going to return t
on a traditional (Clojure-like) implementation of threading macros, but will hang on a binding implementation (e.g. this one).This system contains a package binding-macros
that exports the following symbols:
->
and ->>
,-<>
and -<>>
,some->
and some->>
,some-<>
and some-<>>
,cond->
and cond->>
,cond-<>
and cond-<>>
,->*
,as->
,as->*
.All of the aforementioned threading macros name valid places for use in setf
.
(ql:quickload :binding-arrows)
(asdf:test-system :binding-arrows)
MIT.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The binding-arrows system |
Michał "phoe" Herda <phoe@disroot.org>
MIT
An implementation of threading macros based on binding anonymous variables
1.0.0
binding-arrows.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The binding-arrows.asd file | ||
• The binding-arrows/binding-arrows.lisp file | ||
• The binding-arrows/documentation.lisp file |
Next: The binding-arrows/binding-arrows․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/binding-arrows-20201220-git/binding-arrows.asd
binding-arrows (system)
Next: The binding-arrows/documentation․lisp file, Previous: The binding-arrows․asd file, Up: Lisp files [Contents][Index]
binding-arrows (system)
binding-arrows.lisp
Previous: The binding-arrows/binding-arrows․lisp file, Up: Lisp files [Contents][Index]
binding-arrows (system)
documentation.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The binding-arrows package |
binding-arrows.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
The diamond wand threading macro.
Binds anonymous variables and threads them into subsequent forms:
* by substituting diamond symbols (<>) if they are present in the form,
* as their first arguments (like the -> macro) otherwise.
The diamond symbols are tested by name, not by identity, like LOOP keywords.
The diamond wand does not descend into subforms in its search for diamonds; see the ARROW-MACROS system for an implementation that performs code walking.
For example, the following form:
(-<> foo
bar
(baz)
(quux 1 2 3)
(fred 4 5 6 <>)
(frob 7 <> 8 <> 9))
Is equivalent to:
(let ((temp1 foo)
(temp2 (bar temp1))
(temp3 (baz temp2))
(temp4 (quux temp3 1 2 3))
(temp5 (fred 4 5 6 temp4))
(temp6 (quux 7 temp5 8 temp5 9)))
temp6)
binding-arrows.lisp (file)
(setf -<>) (setf expander)
binding-arrows.lisp (file)
-<> (macro)
The diamond spear threading macro.
Binds anonymous variables and threads them into subsequent forms:
* by substituting diamond symbols (<>) if they are present in the form,
* as their last arguments (like the ->> macro) otherwise.
The diamond symbols are tested by name, not by identity, like LOOP keywords.
The diamond wand does not descend into subforms in its search for diamonds; see the ARROW-MACROS system for an implementation that performs code walking.
For example, the following form:
(-<>> foo
bar
(baz)
(quux 1 2 3)
(fred 4 5 6 <>)
(frob 7 <> 8 <> 9))
Is equivalent to:
(let ((temp1 foo)
(temp2 (bar temp1))
(temp3 (baz temp2))
(temp4 (quux 1 2 3 temp3))
(temp5 (fred 4 5 6 temp4))
(temp6 (quux 7 temp5 8 temp5 9)))
temp6)
binding-arrows.lisp (file)
(setf -<>>) (setf expander)
binding-arrows.lisp (file)
-<>> (macro)
The thread-first threading macro.
Binds anonymous variables and threads them into subsequent forms as their first
arguments.
For example, the following form:
(-> foo
bar
(baz)
(quux 1 2 3))
Is equivalent to:
(let ((temp1 foo)
(temp2 (bar temp1))
(temp3 (baz temp2))
(temp4 (quux temp3 1 2 3)))
temp4)
binding-arrows.lisp (file)
(setf ->) (setf expander)
binding-arrows.lisp (file)
-> (macro)
The inverted thread-first threading macro.
Binds anonymous variables and threads them into subsequent forms as their first
arguments. The order of the forms is altered, so that the last form is used as
the initialization form.
For example, the following form:
(->* bar
(baz)
(quux 1 2 3)
foo)
Is equivalent to:
(-> foo
bar
(baz)
(quux 1 2 3))
And therefore to:
(let ((temp1 foo)
(temp2 (bar temp1))
(temp3 (baz temp2))
(temp4 (quux temp3 1 2 3)))
temp4)
binding-arrows.lisp (file)
(setf ->*) (setf expander)
binding-arrows.lisp (file)
->* (macro)
The thread-last threading macro.
Binds anonymous variables and threads them into subsequent forms as their last
arguments.
For example, the following form:
(->> foo
bar
(baz)
(quux 1 2 3))
Is equivalent to:
(let ((temp1 foo)
(temp2 (bar temp1))
(temp3 (baz temp2))
(temp4 (quux 1 2 3 temp3)))
temp4)
binding-arrows.lisp (file)
(setf ->>) (setf expander)
binding-arrows.lisp (file)
->> (macro)
The named threading macro.
Binds the provided variable to subsequent forms, which may make use of the
bound variable.
For example, the following form:
(as-> foo var
(bar var)
(baz var)
(quux 1 2 3))
Is equivalent to:
(let* ((var foo)
(var (bar var))
(var (baz var))
(var (quux 1 2 3)))
var)
binding-arrows.lisp (file)
(setf as->) (setf expander)
binding-arrows.lisp (file)
as-> (macro)
The inverted named threading macro.
Binds the provided variable to subsequent forms, which may make use of the
bound variable. The order of the forms is altered, so that the last form is used
as the initialization form for the variable.
For example, the following form:
(as->* var
(bar var)
(baz var)
(quux 1 2 3)
foo)
Is equivalent to:
(as-> foo var
(bar var)
(baz var)
(quux 1 2 3))
And therefore to:
(let* ((var foo)
(var (bar var))
(var (baz var))
(var (quux 1 2 3)))
var)
binding-arrows.lisp (file)
(setf as->*) (setf expander)
binding-arrows.lisp (file)
as->* (macro)
The short-cicruiting diamond thread-first threading macro.
Binds anonymous variables and threads them into subsequent forms:
* by substituting diamond symbols (<>) if they are present in the form,
* as their first arguments (like the -> macro) otherwise.
The binding is only effective when the test of a given form returns true.
If any form returns NIL, the subsequent forms are not evaluated, and NIL is
returned.
For example, the following form:
(cond-<> foo
(barp x y z)
(bazp (baz))
((quuxp thing) (quux 1 <> 2 3)))
Is equivalent to:
(let* ((temp1 foo)
(temp2 (if barp
(-<> temp1 x y z)
temp1))
(temp3 (if bazp
(-<> temp2 (baz))
temp2))
(temp4 (if (quuxp thing)
(-<> temp3 (quux 1 <> 2 3))
temp3)))
temp4)
binding-arrows.lisp (file)
(setf cond-<>) (setf expander)
binding-arrows.lisp (file)
cond-<> (macro)
The short-cicruiting diamond thread-last threading macro.
Binds anonymous variables and threads them into subsequent forms:
* by substituting diamond symbols (<>) if they are present in the form,
* as their last arguments (like the ->> macro) otherwise.
The binding is only effective when the test of a given form returns true.
If any form returns NIL, the subsequent forms are not evaluated, and NIL is
returned.
For example, the following form:
(cond-<>> foo
(barp x y z)
(bazp (baz))
((quuxp thing) (quux 1 <> 2 3)))
Is equivalent to:
(let* ((temp1 foo)
(temp2 (if barp
(-<>> temp1 x y z)
temp1))
(temp3 (if bazp
(-<>> temp2 (baz))
temp2))
(temp4 (if (quuxp thing)
(-<>> temp3 (quux 1 <> 2 3))
temp3)))
temp4)
binding-arrows.lisp (file)
(setf cond-<>>) (setf expander)
binding-arrows.lisp (file)
cond-<>> (macro)
The conditional thread-first threading macro.
Binds anonymous variables and threads them into the subsequent forms as their
first arguments, but only when the test of a given form returns true.
For example, the following form:
(cond-> foo
(barp x y z)
(bazp (baz))
((quuxp thing) (quux 1 2 3)))
Is equivalent to:
(let* ((temp1 foo)
(temp2 (if barp
(-> temp1 x y z)
temp1))
(temp3 (if bazp
(-> temp2 (baz))
temp2))
(temp4 (if (quuxp thing)
(-> temp3 (quux 1 2 3))
temp3)))
temp4)
binding-arrows.lisp (file)
(setf cond->) (setf expander)
binding-arrows.lisp (file)
cond-> (macro)
The conditional thread-last threading macro.
Binds anonymous variables and threads them into the subsequent forms as their
last arguments, but only when the test of a given form returns true.
For example, the following form:
(cond->> foo
(barp x y z)
(bazp (baz))
((quuxp thing) (quux 1 2 3)))
Is equivalent to:
(let* ((temp1 foo)
(temp2 (if barp
(->> temp1 x y z)
temp1))
(temp3 (if bazp
(->> temp2 (baz))
temp2))
(temp4 (if (quuxp thing)
(->> temp3 (quux 1 2 3))
temp3)))
temp4)
binding-arrows.lisp (file)
(setf cond->>) (setf expander)
binding-arrows.lisp (file)
cond->> (macro)
The short-cicruiting diamond thread-first threading macro.
Binds anonymous variables and threads them into subsequent forms:
* by substituting diamond symbols (<>) if they are present in the form,
* as their first arguments (like the -> macro) otherwise.
If any form returns NIL, the subsequent forms are not evaluated, and NIL is
returned.
For example, the following form:
(some-<> foo
bar
(baz :baz)
(quux 1 <> 2 3))
Is equivalent to:
(let ((temp1 foo)
(temp2 (and temp1 (bar temp1)))
(temp3 (and temp2 (baz temp2 :baz)))
(temp4 (and temp3 (quux 1 temp3 2 3))))
temp4)
binding-arrows.lisp (file)
(setf some-<>) (setf expander)
binding-arrows.lisp (file)
some-<> (macro)
The short-cicruiting diamond thread-first threading macro.
Binds anonymous variables and threads them into subsequent forms:
* by substituting diamond symbols (<>) if they are present in the form,
* as their last arguments (like the ->> macro) otherwise.
If any form returns NIL, the subsequent forms are not evaluated, and NIL is
returned.
For example, the following form:
(some-<>> foo
bar
(baz :baz)
(quux 1 <> 2 3))
Is equivalent to:
(let ((temp1 foo)
(temp2 (and temp1 (bar temp1)))
(temp3 (and temp2 (baz :baz temp2)))
(temp4 (and temp3 (quux 1 temp3 2 3))))
temp4)
binding-arrows.lisp (file)
(setf some-<>>) (setf expander)
binding-arrows.lisp (file)
some-<>> (macro)
The short-cicruiting thread-first threading macro.
Binds anonymous variables and threads them into subsequent forms as their first
arguments. If any form returns NIL, the subsequent forms are not evaluated, and
NIL is returned.
For example, the following form:
(some-> foo
bar
(baz)
(quux 1 2 3))
Is equivalent to:
(let ((temp1 foo)
(temp2 (and temp1 (bar temp1)))
(temp3 (and temp2 (baz temp2)))
(temp4 (and temp3 (quux temp3 1 2 3))))
temp4)
binding-arrows.lisp (file)
(setf some->) (setf expander)
binding-arrows.lisp (file)
some-> (macro)
The short-cicruiting thread-last threading macro.
Binds anonymous variables and threads them into subsequent forms as their last
arguments. If any form returns NIL, the subsequent forms are not evaluated, and
NIL is returned.
For example, the following form:
(some->> foo
bar
(baz)
(quux 1 2 3))
Is equivalent to:
(let ((temp1 foo)
(temp2 (and temp1 (bar temp1)))
(temp3 (and temp2 (baz temp2)))
(temp4 (and temp3 (quux 1 2 3 temp3))))
temp4)
binding-arrows.lisp (file)
(setf some->>) (setf expander)
binding-arrows.lisp (file)
some->> (macro)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros | ||
• Internal functions |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
binding-arrows.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
binding-arrows.lisp (file)
Previous: Internal macros, Up: Internal definitions [Contents][Index]
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
binding-arrows.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | B F L |
---|
Jump to: | B F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
-
A C D E F I M S V |
---|
Jump to: | (
-
A C D E F I M S V |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
* | |||
*valid-cl-place-forms* : | Internal special variables | ||
| |||
S | |||
Special Variable, *valid-cl-place-forms* : | Internal special variables | ||
|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | B P S |
---|
Jump to: | B P S |
---|