[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: historical question about CASE
Date: Thu, 11 Jun 87 10:07:37 PDT
From: Andy Freeman <FREEMAN@sumex-aim.stanford.edu>
You wrote:
I use the idiom ",@(when foo `(...baz...))" a LOT.
I thought that it was considered poor style to use "when" for its
value. I may be confusing my dialects, but is there actually a
guarantee that "when"'s definition is much like following?
(defmacro when (pred &body x)
`(if , pred (progn '() ,@ x)
'()))
Yes, there is such a guarantee: the second sentence of the
description of WHEN in CLTL, page 115. (Did you look there?)
I agree that in this case I am not consistent; strictly speaking
perhaps AND is more appropriate, but I find WHEN mnemonically
more appealing in this context, and there is no question that
the value is being used, because of the presence of ",@" right
before the form.
--Guy