Next Previous Up Top Contents Index

12 The LISPWORKS Package

top-level-form

Macro

Summary

Use a specified name as a parent name in the specified body of forms.
Package

lispworks

Signature

top-level-form name &body body => result

Arguments

name

The name to use as the parent.

body

The forms across which to use name as the parent.

Values

value

The result of evaluating body.

Description

This macro is useful in the expansion of defining macros. Every form in the body is given name as its parent name. This can be useful for things such as debugging.
top-level-form is exported from theLISPWORKS package.
Example

Compiling the file
(in-package "CL-USER")

(defmacro define-thing (name value) '(top-level-form (define-thing ,name) (install-thing ',name ,value)))

(defun install-thing (x y) (set x y))

(define-thing the-thing 42) (define-thing some-thing 43)

gives messages such as
; (DEFINE-THING THE-THING)
; (DEFINE-THING SOME-THING)

rather than the more cryptic
; (TOP-LEVEL-FORM 3)

which is the default.
In addition, LispWorks is able to find the source of this form if after typingMeta-. you enter
(define-thing the-thing)


LispWorks Reference Manual - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker