The easy-bind Reference Manual

Table of Contents

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

The easy-bind Reference Manual

This is the easy-bind Reference Manual, version 1.0, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 08:47:11 2019 GMT+0.


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

1 Introduction


  ---------- EASY-BIND - Easy local binding for Common Lisp ----------


 Version 1.1
 Copyright (C) Marius Gaarde 2018. All rights reserved. Licensed under the MIT license.

 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
 

Easy-bind is a collection of macros that make the binding of local variables, functions and macros 
in Common Lisp more convenient. It adopts the "paren-free" equational syntax for binding local 
variables from the loop facility, and generalizes it to a simple domain-specific language for local 
binding. It provides a facility for easily defining new binding forms that use a similar paren-
reduced syntax.

See the file documentation.txt for details.

The full text of the license follows:

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


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 easy-bind

Author

Marius Gaarde

License

MIT

Description

Easy-bind - easy local binding for Common Lisp

Version

1.0

Source

easy-bind.asd (file)

Components

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 easy-bind.asd

Location

easy-bind.asd

Systems

easy-bind (system)


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

3.1.2 easy-bind/easy-bind-package.lisp

Parent

easy-bind (system)

Location

easy-bind-package.lisp

Packages

edraag.easy-bind


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

3.1.3 easy-bind/easy-bind-main.lisp

Dependency

easy-bind-package.lisp (file)

Parent

easy-bind (system)

Location

easy-bind-main.lisp

Exported Definitions
Internal Definitions

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

3.1.4 easy-bind/letmatch.lisp

Dependency

easy-bind-main.lisp (file)

Parent

easy-bind (system)

Location

letmatch.lisp

Exported Definitions

letmatch (macro)

Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 edraag.easy-bind

Source

easy-bind-package.lisp (file)

Nicknames
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: define-binding-form NAME &key LEFT-HAND-PRED SEPARATOR-PRED FORM-GENERATOR
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: let+ &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: let- &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: letfun &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: letfun- &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: letmacro &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: letmatch KEY-EXPR &body BODY

Conditional form of let+ which expands into a cond form where the test-forms are calls to ‘matches’ to check if the structure of each binding-list in the body matches that of key-expr. The body should consist of pairs of binding-lists and forms separated by a fat-arrow (=>). The first binding-list that matches is bound to key-expr in a let+ form (at runtime), its right-hand form becoming the body of the let+ form.

Package

edraag.easy-bind

Source

letmatch.lisp (file)

Macro: letsym &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: letval &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: multi-let &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Macro: with &rest FORMS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Functions

Function: all-keyword-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: collect-binding-list BINDINGS LEFT-HAND-SIDE-PREDICATE

Takes a list ((a b) (c d) ...) and collects elems (x y) into new list only as long as a, c, ... satisfies predicate.

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: collect-let+-complex-bindings BINDINGS

Complex-binding-collector to be passed to generate-let*s-and-complex-bindings when generating a let+-style binding form. As such it returns 3 values: a form-name (symbol), a binding list, and the number of binding pairs from the passed-in binding list it lays claim to. It may also returned a 4th value T to indicate that the returned binding list should be spliced into the generated form.

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: complex-left-hand-side-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: consequent-sign-p X
Package

edraag.easy-bind

Source

letmatch.lisp (file)

Function: equals-sign-or-being-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: equals-sign-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: function-binding-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: function-bindings-splice-implicit-progn BINDINGS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: function-keyword-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-function-binding-list BINDINGS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-let*s-and-complex-bindings BINDINGS BODY COMPLEX-BINDING-COLLECTOR

Generates a LET* form as long as it can collect simple bindings, and complex bindings into a form or forms determined by complex-binding-collector, alternately nested until binding list exhausted, at which point body is spliced into the innermost form. Recognizes the :all keyword and handles bindings accordingly.

Complex-binding-collector must be a function which takes the binding list as argument and returns 3 values: 1) a form-name (a symbol), 2) a list of bindings to give to the form, 3) the number of successive bindings it lays claim to from the passed-in binding list. It may also return a 4th value: whether (default nil) to splice the returned binding list into the generated form.

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-let*s-and-function-bindings BINDINGS BODY FORM-NAME

Used to create a form-generator for generating nested let* and <form-name> forms. Form-name must be a symbol which names a CL form that expects function-like bindings, such as labels or macrolet.

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-let*s-and-labels BINDINGS BODY
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-let*s-and-macrolets BINDINGS BODY
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-let*s-and-multiple-value-binds BINDINGS BODY
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-let+-expansion BINDINGS BODY
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-let-binding-list BINDINGS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: generate-symbol-macrolet-bindings BINDINGS
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: ignorablep X
Package

edraag.easy-bind

Source

letmatch.lisp (file)

Function: let+-collect-function-bindings BINDINGS KEYWORD-PREDICATE

Used to collect binding pairs where the first element is a list which begins with a keyword like :fun or :macro, and transforming these to bindings which can be used by forms like labels and macrolet. Collects bindings only as long as they satisfy predicate.

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: letmatch-body-check-wellformedness FORMS
Package

edraag.easy-bind

Source

letmatch.lisp (file)

Function: macro-binding-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: macro-keyword-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: make-function-binding BINDING

Transforms binding ((fn x y) (do-stuff x y)) => (fn (x y) (do-stuff x y)).

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: map-leaves TREE PREDICATE REPLACEMENT-FN

Finds the leaves of the tree and conses up a similar tree where the leaves are replaced according to replacement-fn, but only if they satisfy predicate.

Package

edraag.easy-bind

Source

letmatch.lisp (file)

Function: matches X Y

Implements the rules for matching a left-hand side (x) to a given key-expression (y) in a letmatch form.

Package

edraag.easy-bind

Source

letmatch.lisp (file)

Function: multiple-of N M
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: nmap-leaves TREE PREDICATE ACTION

Non-consing version of map-leaves. Returns nil, or the result of applying action if tree is an atom and satisfies predicate.

Package

edraag.easy-bind

Source

letmatch.lisp (file)

Function: parse-separated-list FORMS LEFT-HAND-SIDE-PREDICATE SEPARATOR-PREDICATE

Parses the forms only as long as pairs of forms are joined according to separator-predicate, like so: (a1 <separator> a2 b1 <separator> b2 ...), and a1, b1... satisfies left-hand-side-predicate. Returns 2 values: 1) a list ((a1 a2) (b1 b2) ...), 2) the number of forms processed, including separators.

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: simple-left-hand-side-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: simple-or-complex-left-hand-side-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: single-splice-implicit-progn FUNCTION-BINDING

Removes the outer list surrounding the ‘implicit progn’ of a function-binding right-hand side (body).

Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: splice-implicit-progn FORMS

Remove outer list around right-hand sides of arguments to letmatch.

Package

edraag.easy-bind

Source

letmatch.lisp (file)

Function: sym-keyword-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)

Function: values-keyword-p X
Package

edraag.easy-bind

Source

easy-bind-main.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   E   F   L  
Index Entry  Section

E
easy-bind.asd: The easy-bind<dot>asd file
easy-bind/easy-bind-main.lisp: The easy-bind/easy-bind-main<dot>lisp file
easy-bind/easy-bind-package.lisp: The easy-bind/easy-bind-package<dot>lisp file
easy-bind/letmatch.lisp: The easy-bind/letmatch<dot>lisp file

F
File, Lisp, easy-bind.asd: The easy-bind<dot>asd file
File, Lisp, easy-bind/easy-bind-main.lisp: The easy-bind/easy-bind-main<dot>lisp file
File, Lisp, easy-bind/easy-bind-package.lisp: The easy-bind/easy-bind-package<dot>lisp file
File, Lisp, easy-bind/letmatch.lisp: The easy-bind/letmatch<dot>lisp file

L
Lisp File, easy-bind.asd: The easy-bind<dot>asd file
Lisp File, easy-bind/easy-bind-main.lisp: The easy-bind/easy-bind-main<dot>lisp file
Lisp File, easy-bind/easy-bind-package.lisp: The easy-bind/easy-bind-package<dot>lisp file
Lisp File, easy-bind/letmatch.lisp: The easy-bind/letmatch<dot>lisp file

Jump to:   E   F   L  

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

A.2 Functions

Jump to:   A   C   D   E   F   G   I   L   M   N   P   S   V   W  
Index Entry  Section

A
all-keyword-p: Internal functions

C
collect-binding-list: Internal functions
collect-let+-complex-bindings: Internal functions
complex-left-hand-side-p: Internal functions
consequent-sign-p: Internal functions

D
define-binding-form: Exported macros

E
equals-sign-or-being-p: Internal functions
equals-sign-p: Internal functions

F
Function, all-keyword-p: Internal functions
Function, collect-binding-list: Internal functions
Function, collect-let+-complex-bindings: Internal functions
Function, complex-left-hand-side-p: Internal functions
Function, consequent-sign-p: Internal functions
Function, equals-sign-or-being-p: Internal functions
Function, equals-sign-p: Internal functions
Function, function-binding-p: Internal functions
Function, function-bindings-splice-implicit-progn: Internal functions
Function, function-keyword-p: Internal functions
Function, generate-function-binding-list: Internal functions
Function, generate-let*s-and-complex-bindings: Internal functions
Function, generate-let*s-and-function-bindings: Internal functions
Function, generate-let*s-and-labels: Internal functions
Function, generate-let*s-and-macrolets: Internal functions
Function, generate-let*s-and-multiple-value-binds: Internal functions
Function, generate-let+-expansion: Internal functions
Function, generate-let-binding-list: Internal functions
Function, generate-symbol-macrolet-bindings: Internal functions
Function, ignorablep: Internal functions
Function, let+-collect-function-bindings: Internal functions
Function, letmatch-body-check-wellformedness: Internal functions
Function, macro-binding-p: Internal functions
Function, macro-keyword-p: Internal functions
Function, make-function-binding: Internal functions
Function, map-leaves: Internal functions
Function, matches: Internal functions
Function, multiple-of: Internal functions
Function, nmap-leaves: Internal functions
Function, parse-separated-list: Internal functions
Function, simple-left-hand-side-p: Internal functions
Function, simple-or-complex-left-hand-side-p: Internal functions
Function, single-splice-implicit-progn: Internal functions
Function, splice-implicit-progn: Internal functions
Function, sym-keyword-p: Internal functions
Function, values-keyword-p: Internal functions
function-binding-p: Internal functions
function-bindings-splice-implicit-progn: Internal functions
function-keyword-p: Internal functions

G
generate-function-binding-list: Internal functions
generate-let*s-and-complex-bindings: Internal functions
generate-let*s-and-function-bindings: Internal functions
generate-let*s-and-labels: Internal functions
generate-let*s-and-macrolets: Internal functions
generate-let*s-and-multiple-value-binds: Internal functions
generate-let+-expansion: Internal functions
generate-let-binding-list: Internal functions
generate-symbol-macrolet-bindings: Internal functions

I
ignorablep: Internal functions

L
let+: Exported macros
let+-collect-function-bindings: Internal functions
let-: Exported macros
letfun: Exported macros
letfun-: Exported macros
letmacro: Exported macros
letmatch: Exported macros
letmatch-body-check-wellformedness: Internal functions
letsym: Exported macros
letval: Exported macros

M
Macro, define-binding-form: Exported macros
Macro, let+: Exported macros
Macro, let-: Exported macros
Macro, letfun: Exported macros
Macro, letfun-: Exported macros
Macro, letmacro: Exported macros
Macro, letmatch: Exported macros
Macro, letsym: Exported macros
Macro, letval: Exported macros
Macro, multi-let: Exported macros
Macro, with: Exported macros
macro-binding-p: Internal functions
macro-keyword-p: Internal functions
make-function-binding: Internal functions
map-leaves: Internal functions
matches: Internal functions
multi-let: Exported macros
multiple-of: Internal functions

N
nmap-leaves: Internal functions

P
parse-separated-list: Internal functions

S
simple-left-hand-side-p: Internal functions
simple-or-complex-left-hand-side-p: Internal functions
single-splice-implicit-progn: Internal functions
splice-implicit-progn: Internal functions
sym-keyword-p: Internal functions

V
values-keyword-p: Internal functions

W
with: Exported macros

Jump to:   A   C   D   E   F   G   I   L   M   N   P   S   V   W  

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

A.3 Variables


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

A.4 Data types

Jump to:   E   P   S  
Index Entry  Section

E
easy-bind: The easy-bind system
edraag.easy-bind: The edraag<dot>easy-bind package

P
Package, edraag.easy-bind: The edraag<dot>easy-bind package

S
System, easy-bind: The easy-bind system

Jump to:   E   P   S