[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Pushing defmacro hard: destructured &KEY bindings
- To: DCP@quabbin.scrc.symbolics.com, Common-Lisp@sail.stanford.edu
- Subject: Pushing defmacro hard: destructured &KEY bindings
- From: Jeff Mincy <email@example.com>
- Date: Thu, 22 Jan 87 20:42 EST
- In-reply-to: <870122174353.5.DCP@KOYAANISQATSI.S4CC.Symbolics.COM>
Date: Thu, 22 Jan 87 17:43 EST
From: David C. Plummer <DCP@quabbin.scrc.symbolics.com>
Subject: Pushing defmacro hard: destructured &KEY bindings
CLtL pages 149-151 mentions destructuring within lambda list keywords
for defmacro, but don't give enough examples for users to know what is
expected to work and what isn't. Specifically, it does give examples of
destructuring &OPTIONAL, but doesn't say &REST may not be destructured
(it doesn't at first glance make much sense, but program writing
programs may generate it, and it may be a good way to do some further
destructuring) and it is silent on &KEY. For example, is the following
p146 CLtL ... known as destructuring.
"Anywhere in the lambda-list where a parameter name may
appear, and where ordinary lambda-list syntax (5.2.2) does not otherwise
allow a list, a lambda-list may appear in place of the parameter name."
So I'd interpret that to mean any of the following "var"s in
lambda-lists may be replaced with a lambda-list.
&optional (var [initform [svar]])
&key ((key var) [initform [svar]]).
I'd say your examples are valid.