Arc Cross Reference


[macro] defset name params body ...

Defines a generalized set expander procedure. The procedure is invoked when name appears at the car position of the place form in macros like [=], push, pop, swap, rotate, etc.

The procedure receives forms appear in the cdr of place form as arguments, and must return a list of three elements:

  • a list of temporary variable bindings (var expr var2 expr2 ...)
  • a form to get the value of the place,
  • and a form that evaluates to a single-argument function which sets its argument to the place.

The setting is stored in a global table setter, and can be accessed by setforms.

This is more like Common Lisp's defsetf than Scheme's generalized set! (scheme:SRFI-17).