modf

API Reference

modf

A SETF like macro for functional programming

MODF

  • Macro 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.
  • Macro 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).
  • Macro MODF-FN (symbol)
    Expand to the defined Modf function. Basically, (MODF-FN SYM) is the functional analog of #'(SETF SYM).
  • Macro 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.
  • 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.
  • Macro 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.
  • Macro FSETF (place value &rest more)
  • Macro MODF-EVAL (&rest args)

MODF-DEF

  • Macro DEFSTRUCT (name-and-options &rest slot-descriptions)
    Define a new structure with Modf expansions for slots.
  • Macro DEFINE-MODF-FOR-STRUCT-SLOTS (structure-definition-form)
    This macro defines Modf expanders for structure slots when given a structure definition form.
  • Macro DEFCLASS (name direct-superclasses direct-slots &rest options)
    Define Modf expansions for class slot accessor and reader methods.
  • Macro DEFINE-MODF-FOR-CLASS-SLOTS (class-name-or-definition)
    This macro defines Modf expanders for a class. We can do this given the definition form for the class (much like with DEFINE-MODF-FOR-STRUCT-SLOTS) or the a name of a finalized class.