A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw71/LW/html/lw-510.htm below:

replacement-source-form

Description

A call to replacement-source-form can be used to allow the debugger and stepper to identify that original-form has been replaced by new-form in a macro expansion. Forms in a macro expansion that are eq to forms in the arguments to the macro will be identified automatically, but some macros (such as iterate ) need to generate new forms that are equivalent to the original forms and wrapping them with replacement-source-form allows them to be identified too.

original-form should be a form that occurred in the arguments to the macro and does not otherwise occur in the expansion of the macro. new-form should be a form that was created by the macro.

The value of new-form, new-form-value, is returned when the replacement-source-form form is evaluated.

Examples

Without the dspec:replacement-source-form, the calls to pprint would be unknown to the debugger and stepper because the forms do not occur in the original source code:

(defmacro pprint-for-print (&body forms)
  `(progn
     ,@(loop for form in forms
             collect
             (if (and (consp form)
                      (eq (car form) 'print))
                 `(dspec:replacement-source-form
                   ,form
                   (pprint ,@(cdr form)))
               form))))

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4