This is the metabang-bind Reference Manual, version 0.8.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:06:04 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
metabang-bind
Bind is a macro that generalizes multiple-value-bind, let, let*, destructuring-bind, structure and slot accessors, and a whole lot more.
Gary Warren King <gwking@metabang.com>
MIT License
0.8.0
dev
(module).
Modules are listed depth-first from the system components tree.
metabang-bind/dev
metabang-bind
(system).
packages.lisp
(file).
macros.lisp
(file).
bind.lisp
(file).
binding-forms.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
metabang-bind/metabang-bind.asd
metabang-bind/dev/packages.lisp
metabang-bind/dev/macros.lisp
metabang-bind/dev/bind.lisp
metabang-bind/dev/binding-forms.lisp
metabang-bind/metabang-bind.asd
metabang-bind
(system).
metabang-bind/dev/macros.lisp
packages.lisp
(file).
dev
(module).
binding-form-docstring
(function).
(setf binding-form-docstring)
(function).
lambda-bind
(macro).
defbinding-form
(macro).
next-value
(function).
metabang-bind/dev/bind.lisp
macros.lisp
(file).
dev
(module).
*bind-all-declarations*
(special variable).
*bind-lambda-list-markers*
(special variable).
*bind-non-var-declarations*
(special variable).
*unused-declarations-behavior*
(special variable).
bind
(macro).
bind-error
(condition).
bind-keyword/optional-nil-with-default-error
(condition).
bind-missing-value-form-warning
(condition).
bind-too-many-value-forms-error
(condition).
bind-unused-declarations-condition
(condition).
bind-unused-declarations-error
(condition).
bind-unused-declarations-warning
(condition).
binding-form-groups
(function).
binding-form-synonyms
(function).
binding-forms
(function).
fluid-bind
(macro).
*all-declarations*
(special variable).
*bind-simple-var-declarations*
(special variable).
+code-marker+
(constant).
+decl-marker+
(constant).
bad-variable
(reader method).
bind-collect-variables
(method).
bind-expand-declarations
(function).
bind-filter-declarations
(function).
bind-fix-nils
(function).
bind-fix-nils-destructured
(function).
bind-get-vars-from-lambda-list
(function).
bind-macro-helper
(function).
binding
(reader method).
binding-form-accepts-multiple-forms-p
(generic function).
check-for-unused-variable-declarations
(function).
dotted-pair-p
(function).
map-tree
(function).
merge-binding-forms-p
(function).
mint-ignorable-variable
(function).
simple-style-warning
(function).
simple-style-warning
(condition).
tree-find
(function).
unused-declarations
(reader method).
value-form
(reader method).
var-ignorable-p
(function).
variable-form
(reader method).
variable-form
(reader method).
metabang-bind/dev/binding-forms.lisp
bind.lisp
(file).
dev
(module).
bind-generate-bindings
(generic function).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
binding-form-accepts-multiple-forms-p
(method).
find-type-declaration
(function).
handle-plist
(function).
Packages are listed by definition order.
metabang.bind
bind
metabang-bind
common-lisp
.
*bind-all-declarations*
(special variable).
*bind-lambda-list-markers*
(special variable).
*bind-non-var-declarations*
(special variable).
*unused-declarations-behavior*
(special variable).
bind
(macro).
bind-error
(condition).
bind-keyword/optional-nil-with-default-error
(condition).
bind-missing-value-form-warning
(condition).
bind-too-many-value-forms-error
(condition).
bind-unused-declarations-condition
(condition).
bind-unused-declarations-error
(condition).
bind-unused-declarations-warning
(condition).
binding-form-docstring
(function).
(setf binding-form-docstring)
(function).
binding-form-groups
(function).
binding-form-synonyms
(function).
binding-forms
(function).
fluid-bind
(macro).
lambda-bind
(macro).
*all-declarations*
(special variable).
*bind-simple-var-declarations*
(special variable).
+code-marker+
(constant).
+decl-marker+
(constant).
bad-variable
(generic reader).
bind-collect-variables
(generic function).
bind-expand-declarations
(function).
bind-filter-declarations
(function).
bind-fix-nils
(function).
bind-fix-nils-destructured
(function).
bind-generate-bindings
(generic function).
bind-get-vars-from-lambda-list
(function).
bind-macro-helper
(function).
binding
(generic reader).
binding-form-accepts-multiple-forms-p
(generic function).
check-for-unused-variable-declarations
(function).
defbinding-form
(macro).
dotted-pair-p
(function).
find-type-declaration
(function).
handle-plist
(function).
map-tree
(function).
merge-binding-forms-p
(function).
mint-ignorable-variable
(function).
next-value
(function).
simple-style-warning
(function).
simple-style-warning
(condition).
tree-find
(function).
unused-declarations
(generic reader).
value-form
(generic reader).
var-ignorable-p
(function).
variable-form
(generic reader).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Tells bind how to behave when it encounters an unused declaration.
The possible options are
* :print-warning (the current default) - print a warning about the problem
and signal a ‘bind-unused-declarations-condition‘
* :warn - signal a ‘bind-unused-declarations-warning‘ warning
* :error - signal a ‘bind-unused-declarations-error‘ error
Bind is a replacement for let*, destructuring-bind, multiple-value-bind and more.
An example is probably the best way to describe its syntax:
(bind ((a 2)
((b &rest args &key (c 2) &allow-other-keys) ’(:a :c 5 :d 10 :e 54))
((:values d e) (truncate 4.5))
((:structure xxx- slot1 slot2) (make-xxx))
((:flet name (arg1 arg2)) (+ arg1 arg2)))
(list a b c d e args))
Simple bindings are as in let*. Destructuring is done if the first item
in a binding is a list. Multiple value binding is done if the first item
in a binding is a list and the first item in the list is ’:values’. Other
forms have their own syntax. For example, :structure first has the conc
name and then slot names whereas :flet has the function name and a list
of arguments and then the function body (in an implicit progn).
Fluid-bind is an extension of bind that handles setting and resetting places. For example, suppose that an object of class foo has a slot named bar whose value is currently 3. The following code would evaluate the inner body with bar bound to 17 and restore it when the inner body is exited.
(fluid-bind (((bar foo) 17))
(print (bar foo)))
(print (bar foo))
==> (prints 17, then 3)
This is similar to dynamic-binding but _much_ less robust.
Use ‘bind’ to allow restructuring of argument to lambda expressions.
This lets you funcall and destructure simultaneously. For example
(let ((fn (lambda-bind ((a b) c) (cons a c))))
(funcall fn ’(1 2) 3))
;; => (1 . 3)
Via eschulte (see git://gist.github.com/902174.git).
Returns the docstring for a binding form named ‘name‘.
Return a list of the available binding-forms grouped into their synonyms.
Return a list of synonyms for the binding-form ‘name‘.
For example
> (binding-form-synonyms :accessors)
(:accessors :writable-accessors)
Return a list of all binding-forms that bind supports in alphabetical order.
error
.
(quote nil)
:bad-variable
This slot is read-only.
(quote nil)
:variable-form
This slot is read-only.
condition
.
(quote (error "must supply unused-declarations"))
:unused-declarations
This slot is read-only.
Describe how ‘bind‘ should expand particular binding-forms.
‘defbinding-form‘ links a name or type with an expansion. These definitions are used by ‘bind‘ at macro-expansion time to generate the code that actually does the bindings for you. For example:
(defbinding-form (symbol :use-values-p nil)
(if (keywordp kind)
(error "Don’t have a binding form for ~s" kind)
‘(let (,@(if values
‘((,variables ,values))
‘(,variables))))))
This binding form tells to expand clauses whose first element is a symbol using ‘let‘. (It also gets ‘bind‘ to signal an error if the first element is a keyword that doesn’t have a defined binding form.)
Returns true if and only if ‘putative-pair‘ is a dotted-list. I.e., if ‘putative-pair‘ is a cons cell with a non-nil cdr.
apply ‘fn‘ to every leaf of ‘object‘.
bind-keyword/optional-nil-with-default-error
)) ¶Handle the expansion for a particular binding-form.
‘kind‘ specifies the binding form. It can be a type (e.g., symbol or array) or a keyword (e.g., :flet or :plist). ‘variable-form‘ and ‘value-form‘ are taken from the binding-form given to ‘bind‘. E.g., if you have a bind like
(bind (((:values a b c) (foo))
(x 2))
(declare (optimize (speed 3)) (type simple-array a))
...)
then ‘kind‘ will be :values, ‘variable-form‘ will be the list ‘(a b c)‘ and ‘value-form‘ will be the expression ‘(foo)‘. ‘bind-generate-bindings‘ uses these variables as data to construct the generated code.
(eql :file)
) variable-form value-form) ¶(eql :plist-)
) variable-form value-form) ¶(eql :properties)
) variable-form value-form) ¶(eql :property-list)
) variable-form value-form) ¶(eql :plist)
) variable-form value-form) ¶(eql :writable-accessors)
) variable-form value-form) ¶(eql :accessors)
) variable-form value-form) ¶(eql :accessors-r/o)
) variable-form value-form) ¶(eql :accessors-read-only)
) variable-form value-form) ¶(eql :read-only-accessors)
) variable-form value-form) ¶(eql :slots)
) variable-form value-form) ¶(eql :slots-r/o)
) variable-form value-form) ¶(eql :slots-read-only)
) variable-form value-form) ¶(eql :read-only-slots)
) variable-form value-form) ¶(eql :assoc)
) variable-form value-form) ¶(eql :alist)
) variable-form value-form) ¶(eql :structure/rw)
) variable-form value-form) ¶(eql :structure)
) variable-form value-form) ¶(eql :struct)
) variable-form value-form) ¶(eql :multiple-value-bind)
) variable-form value-form) ¶(eql :mv-bind)
) variable-form value-form) ¶(eql :values)
) variable-form value-form) ¶cons
) variable-form value-form) ¶(eql :flabels)
) variable-form value-form) ¶(eql :dynamic-labels)
) variable-form value-form) ¶(eql :labels)
) variable-form value-form) ¶(eql :dflet)
) variable-form value-form) ¶(eql :dynamic-flet)
) variable-form value-form) ¶(eql :flet)
) variable-form value-form) ¶symbol
) variable-form value-form) ¶array
) variable-form value-form) ¶bind-error
)) ¶Returns true if a binding form can accept multiple forms (e.g., :flet)
(eql :file)
)) ¶(eql :plist-)
)) ¶(eql :properties)
)) ¶(eql :property-list)
)) ¶(eql :plist)
)) ¶(eql :writable-accessors)
)) ¶(eql :accessors)
)) ¶(eql :accessors-r/o)
)) ¶(eql :accessors-read-only)
)) ¶(eql :read-only-accessors)
)) ¶(eql :slots)
)) ¶(eql :slots-r/o)
)) ¶(eql :slots-read-only)
)) ¶(eql :read-only-slots)
)) ¶(eql :assoc)
)) ¶(eql :alist)
)) ¶(eql :structure/rw)
)) ¶(eql :structure)
)) ¶(eql :struct)
)) ¶(eql :multiple-value-bind)
)) ¶(eql :mv-bind)
)) ¶(eql :values)
)) ¶(eql :flabels)
)) ¶(eql :dynamic-labels)
)) ¶(eql :labels)
)) ¶(eql :dflet)
)) ¶(eql :dynamic-flet)
)) ¶(eql :flet)
)) ¶bind-unused-declarations-condition
)) ¶bind-too-many-value-forms-error
)) ¶bind-too-many-value-forms-error
)) ¶bind-missing-value-form-warning
)) ¶simple-warning
.
style-warning
.
Jump to: | (
B C D F G H L M N S T U V |
---|
Jump to: | (
B C D F G H L M N S T U V |
---|
Jump to: | *
+
B C S U V |
---|
Jump to: | *
+
B C S U V |
---|
Jump to: | B C D F M P S |
---|
Jump to: | B C D F M P S |
---|