anaphora

API Reference

anaphora

The Anaphoric Macro Package from Hell

ANAPHORA

ANAPHORA provides a full complement of anaphoric macros. Subsets of the
functionality provided by this package are exported from ANAPHORA-BASIC and
ANAPHORA-SYMBOL.
  • Macro ALET (form &body body)
    Binds the FORM to IT (via LET) in the scope of the BODY.
  • Macro SLET (form &body body)
    Binds the FORM to IT (via SYMBOL-MACROLET) in the scope of the BODY. IT can be set with SETF.
  • Macro AAND (first &rest rest)
    Like AND, except binds the first argument to IT (via LET) for the scope of the rest of the arguments.
  • Macro SOR (first &rest rest)
    Like OR, except binds the first argument to IT (via SYMBOL-MACROLET) for the scope of the rest of the arguments. IT can be set with SETF.
  • Macro AIF (test then &optional else)
    Like IF, except binds the result of the test to IT (via LET) for the scope of the then and else expressions.
  • Macro SIF (test then &optional else)
    Like IF, except binds the test form to IT (via SYMBOL-MACROLET) for the scope of the then and else expressions. IT can be set with SETF
  • Macro ASIF (test then &optional else)
    Like IF, except binds the result of the test to IT (via LET) for the the scope of the then-expression, and the test form to IT (via SYMBOL-MACROLET) for the scope of the else-expression. Within scope of the else-expression, IT can be set with SETF.
  • Macro APROG1 (first &body rest)
    Binds IT to the first form so that it can be used in the rest of the forms. The whole thing returns IT.
  • Macro AWHEN (test &body body)
    Like WHEN, except binds the result of the test to IT (via LET) for the scope of the body.
  • Macro SWHEN (test &body body)
    Like WHEN, except binds the test form to IT (via SYMBOL-MACROLET) for the scope of the body. IT can be set with SETF.
  • Macro SUNLESS (test &body body)
    Like UNLESS, except binds the test form to IT (via SYMBOL-MACROLET) for the scope of the body. IT can be set with SETF.
  • Macro ACASE (keyform &body cases)
    Like CASE, except binds the result of the keyform to IT (via LET) for the scope of the cases.
  • Macro SCASE (keyform &body cases)
    Like CASE, except binds the keyform to IT (via SYMBOL-MACROLET) for the scope of the body. IT can be set with SETF.
  • Macro AECASE (keyform &body cases)
    Like ECASE, except binds the result of the keyform to IT (via LET) for the scope of the cases.
  • Macro SECASE (keyform &body cases)
    Like ECASE, except binds the keyform to IT (via SYMBOL-MACROLET) for the scope of the cases. IT can be set with SETF.
  • Macro ACCASE (keyform &body cases)
    Like CCASE, except binds the result of the keyform to IT (via LET) for the scope of the cases. Unlike CCASE, the keyform/place doesn't receive new values possibly stored with STORE-VALUE restart; the new value is received by IT.
  • Macro SCCASE (keyform &body cases)
    Like CCASE, except binds the keyform to IT (via SYMBOL-MACROLET) for the scope of the cases. IT can be set with SETF.
  • Macro ATYPECASE (keyform &body cases)
    Like TYPECASE, except binds the result of the keyform to IT (via LET) for the scope of the cases.
  • Macro STYPECASE (keyform &body cases)
    Like TYPECASE, except binds the keyform to IT (via SYMBOL-MACROLET) for the scope of the cases. IT can be set with SETF.
  • Macro AETYPECASE (keyform &body cases)
    Like ETYPECASE, except binds the result of the keyform to IT (via LET) for the scope of the cases.
  • Macro SETYPECASE (keyform &body cases)
    Like ETYPECASE, except binds the keyform to IT (via SYMBOL-MACROLET) for the scope of the cases. IT can be set with SETF.
  • Macro ACTYPECASE (keyform &body cases)
    Like CTYPECASE, except binds the result of the keyform to IT (via LET) for the scope of the cases. Unlike CTYPECASE, new values possible stored by the STORE-VALUE restart are not received by the keyform/place, but by IT.
  • Macro SCTYPECASE (keyform &body cases)
    Like CTYPECASE, except binds the keyform to IT (via SYMBOL-MACROLET) for the scope of the cases. IT can be set with SETF.
  • Macro ACOND (&body clauses)
    Like COND, except result of each test-form is bound to IT (via LET) for the scope of the corresponding clause.
  • Macro SCOND (&body clauses)
    Like COND, except each test-form is bound to IT (via SYMBOL-MACROLET) for the scope of the corresponsing clause. IT can be set with SETF.

ANAPHORA-BASIC

ANAPHORA-BASIC provides all normal anaphoric constructs, which bind
primary values to IT.
No exported symbols.

Also exports

  • ANAPHORA:AIF
  • ANAPHORA:AAND
  • ANAPHORA:APROG1
  • ANAPHORA:ACCASE
  • ANAPHORA:IT
  • ANAPHORA:ACOND
  • ANAPHORA:AETYPECASE
  • ANAPHORA:ACTYPECASE
  • ANAPHORA:AECASE
  • ANAPHORA:ALET
  • ANAPHORA:ACASE
  • ANAPHORA:AWHEN
  • ANAPHORA:ATYPECASE

ANAPHORA-SYMBOL

ANAPHORA-SYMBOL provides ``symbolic anaphoric macros'', which bind forms
to IT via SYMBOL-MACROLET. 

Examples:

  (sor (gethash key table) (setf it default))

  (asif (gethash key table)
        (foo it)            ; IT is a value bound by LET here
        (setf it default))  ; IT is the GETHASH form bound by SYMBOL-MACROLET here
No exported symbols.

Also exports

  • ANAPHORA:STYPECASE
  • ANAPHORA:SCOND
  • ANAPHORA:IT
  • ANAPHORA:SWHEN
  • ANAPHORA:SECASE
  • ANAPHORA:SCCASE
  • ANAPHORA:SCTYPECASE
  • ANAPHORA:SETYPECASE
  • ANAPHORA:SOR
  • ANAPHORA:ASIF
  • ANAPHORA:SCASE
  • ANAPHORA:SIF
  • ANAPHORA:SUNLESS
  • ANAPHORA:SLET