Submitter's name: Pascal Costanza
Submitter's email address: pc_at_p-cos.net
Type of issue: Defect
Priority: Minor
R6RS component: Macros
Version of the report: 5.91
One-sentence summary of the issue: Implementing Common Lisp's
defmacro is not straightforward.
Full description of the issue:
Section 17.6, page 113, last paragraph, states that "Using lisp-
transformer, defining a basic version of Common Lisp's defmacro is a
straightforward exercise."
This is misleading. It is true that Common Lisp's destructuring
facilities in its macro lambda lists, as well as the inclusion of
optional and keyword arguments, are merely syntactic sugar. However,
Common Lisp macros also provide access to the lexical environment of
a macro invocation via environment objects. See Sections 3.4.4 and
3.1.1.4 in the ANSI Common Lisp specification [1]. I doubt that it's
straightforward to reimplement environment objects using syntax-case.
I suggest to drop this sentence completely. The preceding paragraph
already mentions that lisp-transformer can be used to "write macros
in the style of old Lisp macros", and that seems to be a sufficient
motivation for this example.
Pascal
[1]
http://www.lispworks.com/documentation/HyperSpec/Front/index.htm
--
Pascal Costanza, mailto:pc_at_p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium
Received on Sun Sep 17 2006 - 14:42:05 UTC