Common Lisp Package: LET-PLUS

README:

FUNCTION

Private

&-SYMBOL? (SYMBOL)

Test whether the symbol's name starts with a & character.

DESTRUCTURED-LAMBDA-LIST-FORMS (LAMBDA-LIST BODY)

Return a list that can be spliced into function definitions (eg DEFUN, LAMBDA, FLET, LABELS). The list starts with a lambda list, and is followed by a docstring (when provided), then a LET+ form that wraps declarations (when provided) and BODY. Used internally, not exported.

EXPAND-ARRAY-ELEMENTS (VALUE ARRAY-ELEMENTS &OPTIONAL (ACCESSOR 'AREF))

Expand a list of (BINDING &REST SUBSCRIPTS) forms to a list of bindings of the form (ACCESSOR VALUE SUBSCRIPTS).

EXPAND-ENTRY-FORMS (ENTRIES ACCESSOR-GENERATOR)

Return a list of expanded bindings from ENTRIES, calling (ACESSOR-GENERATOR KEY DEFAULT). Each entry is (VARIABLE &OPTIONAL KEY DEFAULT). When KEY is NIL, VARIABLE is used.

EXPAND-SLOT-FORMS (SLOTS ACCESSOR-GENERATOR)

Return a list of expanded bindings, calling (ACCESSOR-GENERATOR KEY)

IGNORED? (SYMBOL)

Return a boolean determining if a variable is to be ignored. NOTE: It is unlikely that you need to used this function, see the note above its definition.

REPLACE-IGNORED (TREE)

Replace ignored variables in TREE with a gensym, return a list of these as the second value. NOTE: It is unlikely that you need to used this function, see the note above its definition.

MACRO

Public

&ACCESSORS (&WHOLE WHOLE317 &REST ACCESSORS)

LET+ form, similar to WITH-ACCESSORS.

&ACCESSORS-R/O (&WHOLE WHOLE347 &REST ACCESSORS)

LET+ form, similar to WITH-ACCESSORS, but read-only.

&ARRAY-ELEMENTS (&WHOLE WHOLE652 &REST ARRAY-ELEMENTS)

LET+ form, mapping (variable &rest subscripts) specifications to array-elements. VARIABLE is an accessor, which can be used for reading and writing array elements.

&ARRAY-ELEMENTS-R/O (&WHOLE WHOLE680 &REST ARRAY-ELEMENTS)

LET+ form, mapping (variable &rest subscripts) specifications to array-elements. Read-only accessor, values assigned to VARIABLEs.

&ASSERT (&WHOLE WHOLE238 TEST-FORM &REST ARGUMENTS)

Expand to (ASSERT TEST-FORM ARGUMENTS) before body.

&COMPLEX (&WHOLE WHOLE318 X Y)

Access real and imaginary part of the value. Read-only.

&FLET (&WHOLE WHOLE711 FUNCTION-NAME LAMBDA-LIST &BODY FUNCTION-BODY)

LET+ form for function definitions. Expands into an FLET.

&FLET+ (&WHOLE WHOLE72 FUNCTION-NAME LAMBDA-LIST &BODY FUNCTION-BODY)

&FLET that destructures its arguments using LET+.

&FWRAP (&WHOLE WHOLE206 NAME)

Wrap closure in the local function NAME. Calls to NAME will call the closure.

&HASH-TABLE (&WHOLE WHOLE899 &REST ENTRIES)

LET+ form for hash tables. Each entry is (variable &optional key default).

&HASH-TABLE-R/O (&WHOLE WHOLE930 &REST ENTRIES)

LET+ form for hash tables. Each entry is (variable &optional key default). Read only version.

&LABELS (&WHOLE WHOLE743 FUNCTION-NAME LAMBDA-LIST &BODY FUNCTION-BODY)

LET+ form for function definitions. Expands into an LABELS, thus allowing recursive functions.

&LABELS+ (&WHOLE WHOLE104 FUNCTION-NAME LAMBDA-LIST &BODY FUNCTION-BODY)

&LABELS that destructures its arguments using LET+.

&MACROLET (&WHOLE WHOLE775 MACRO-NAME LAMBDA-LIST &BODY MACRO-BODY)

LET+ form for local macro definitions. Expands into an MACROLET.

&ONCE-ONLY (&WHOLE WHOLE268 &REST SPECS)

Expand to (ONCE-ONLY SPECS ...).

&PLIST (&WHOLE WHOLE837 &REST ENTRIES)

LET+ form for property lists. Each entry is (variable &optional key default).

&PLIST-R/O (&WHOLE WHOLE868 &REST ENTRIES)

LET+ form for property lists, read only version. Each entry is (variable &optional key default).

&SLOTS (&WHOLE WHOLE377 &REST SLOTS)

LET+ form, similar to WITH-SLOTS.

&SLOTS-R/O (&WHOLE WHOLE402 &REST SLOTS)

LET+ form, similar to WITH-SLOTS but read-only.

&STRUCTURE (&WHOLE WHOLE432 CONC-NAME &REST SLOTS)

LET+ form for slots of a structure, with accessors generated using CONC-NAME.

&STRUCTURE-R/O (&WHOLE WHOLE474 CONC-NAME &REST SLOTS)

LET+ form for slots of a structure, with accessors generated using CONC-NAME. Read-only version.

&SYMBOL-MACROLET (&WHOLE WHOLE807 SYMBOL EXPANSION)

LET+ form for local symbol macros. Expands into a SYMBOL-MACROLET.

&VALUES (&WHOLE WHOLE516 &REST VALUES)

LET+ form for multiple values.

&WITH-GENSYMS (&WHOLE WHOLE293 &REST NAMES)

Expand to (WITH-GENSYMS NAMES ...).

DEFINE-LET+-EXPANSION ((NAME ARGUMENTS &KEY (VALUE-VAR 'VALUE) (BODY-VAR 'BODY) (USES-VALUE? T) (ONCE-ONLY? USES-VALUE?)) &BODY BODY)

Define an expansion for LET+ forms which are lists, starting with NAME. ARGUMENTS is destructured if a list. A placeholder macro is defined with NAME, using DOCSTRING and ARGUMENTS. The value form is bound to VALUE-VAR (wrapped in ONCE-ONLY when ONCE-ONLY?), while the body is bound to BODY-VAR. USES-VALUE? determines if the form uses a value, and generates the appropriate checks.

DEFINE-STRUCTURE-LET+ ((NAME &KEY (CONC-NAME (SYMBOLICATE NAME -)) (R/W (SYMBOLICATE & NAME)) (R/O (SYMBOLICATE & NAME '-R/O))) &REST SLOT-NAMES)

Define a LET+ expansion for accessing slots of a structure in a fixed order.

DEFUN+ (NAME LAMBDA-LIST &BODY BODY)

DEFUN that destructures its arguments using LET+.

LAMBDA+ (LAMBDA-LIST &BODY BODY)

LAMBDA that destructures its arguments using LET+.

LET+ (BINDINGS &BODY BODY)

Destructuring bindings. See the documentation of the LET-PLUS library. Most accepted forms start with &.

GENERIC-FUNCTION

Public

LET+-EXPANSION (FORM VALUE BODY)

Return an expansion for a LET+ form.

LET+-EXPANSION-FOR-LIST (FIRST REST VALUE BODY)

LET+-EXPANSION calls this for lists, see the latter for semantics of returned values.