Common Lisp Package: MODF

README:

FUNCTION

Private

LATE-INVERT (FUNC NEW-VAL OBJ &REST ARGS)

This is a generic catch as much as you can function. It attempts to identify class accessor functions, structure accessor functions, and provides late MODF defined functions (i.e. you used MODF before using DEFINE-MODF-FUNCTION). All of this functionality is less than ideal efficiency wise, but working over efficiency any day, right? If you want better performance, define all of you functions ahead of time.

MKSTR (&REST ARGS)

MaKe STRing

MODF-NAME (SYMBOL)

Make a symbol name that depends on symbol name and package, but is very unlikely to be chosen by anyone. This is for avoiding collisions for my benefit, not the users, as these symbols belong to the MODF package.

Undocumented

ACCESSOR-IN (EXPR)

APPLY-EXPRESSION? (EXPR)

BUILDER:COMMON-LISP:AREF (NEW-VAL ARRAY &REST IDX)

BUILDER:COMMON-LISP:GETHASH (NEW-VAL KEY HASH-TABLE)

BUILDER:COMMON-LISP:LAST (NEW-VAL OBJ)

BUILDER:COMMON-LISP:NTH (NEW-VAL NTH OBJ)

BUILDER:COMMON-LISP:NTHCDR (NEW-VAL NTH OBJ)

BUILDER:COMMON-LISP:SUBSEQ (NEW-VAL SEQ START &OPTIONAL (END (LENGTH SEQ)))

CONTAINER-ARG-N (EXPR)

COPY-INSTANCE (OBJ)

EXPANDABLE? (EXPR)

EXPANSIONS-DEFINED? (EXPR)

FIND-CONTAINER (PLACE)

FUNCALL-EXPRESSION? (EXPR)

LATE-CLASS-READER-INVERTER (FUNC NEW-VAL OBJ)

MODF-EXPAND (NEW-VAL EXPR ENCLOSED-OBJ-SYM ENV)

MODF-FN-DEFINED? (EXPR)

REPLACE-NTH (NTH LIST NEW-VAL)

REPLACE-NTHCDR (NTH LIST NEW-VAL)

MACRO

Public

DEFINE-MODF-EXPANDER (NAME NTH-ARG (EXPR VAL NEW-VAL) &BODY BODY)

Define a new expander which inverts forms starting with NAME. Your function should return an expansion from EXPR to a form that will build a new object that has NEW-VAL in the place specified by expr. NTH-ARG marks which argument is considered the actual data which will be inverted next.

DEFINE-MODF-FUNCTION (NAME NTH-ARG (NEW-VAL &REST ARGS) &BODY BODY)

Define a new modf function. It inverts NAME forms by modifying the NTH-ARG term of the arguments of the place form in the MODF macro.

DEFINE-MODF-METHOD (NAME NTH-ARG (NEW-VAL &REST ARGS) &BODY BODY)

Define a new modf method. It inverts NAME forms by modifying the NTH-ARG term of the arguments of the place form in the MODF macro. This method can specialize on any of ARGS.

DEFINE-MODF-REWRITE (NAME (EXPR) &BODY BODY)

Define a new rewrite rule. If a form starting with NAME is encountered, call the defined function to return a form that we can deal with (i.e. one defined via DEFINE-MODF-EXPANDER, DEFINE-MODF-FUNCTION, and DEFINE-MODF-METHOD).

MODF (PLACE VALUE &REST MORE &ENVIRONMENT ENV)

Make a new object (which may use some of the old object) such that PLACE evaluates to VALUE. MORE should have the form... MORE : NIL | (TEMPORARY-BINDING ANOTHER-MODF-PLACE ANOTHER-VALUE . MORE) Use it to specify a temporary binding for the new object created which will be used in the subsequence MODF-PLACE NEW-VALUE pairs until the end of the MODF form.

MODF-FN (SYMBOL)

Expand to the defined Modf function. Basically, (MODF-FN SYM) is the functional analog of #'(SETF SYM).

Undocumented

FSETF (PLACE VALUE &REST MORE)

MODF-EVAL (&REST ARGS)

Private

WITH-GENSYMS (NAMES &BODY FORMS)

Binds each variable named by a symbol in NAMES to a unique symbol around FORMS. Each of NAMES must either be either a symbol, or of the form: (symbol string-designator) Bare symbols appearing in NAMES are equivalent to: (symbol symbol) The string-designator is used as the argument to GENSYM when constructing the unique symbol the named variable will be bound to.

GENERIC-FUNCTION

Private

Undocumented

BUILDER:COMMON-LISP:PATHNAME-DIRECTORY (NEW-VAL PATH)

BUILDER:COMMON-LISP:PATHNAME-NAME (NEW-VAL PATH)

BUILDER:COMMON-LISP:PATHNAME-TYPE (NEW-VAL PATH)

VARIABLE

Private

*ACCESSOR-HEURISTICS*

This controls whether we should make educated guesses regarding inverting structure slot readers. For strictly correct behavior, set this to nil.

*MODF-EXPANSIONS*

Holds expansion functions

*MODF-NTH-ARG*

Holds what argument to try to invert next.

Undocumented

*MODF-REWRITES*

*SPECIAL-MODF-FORMS*