(I merged your EVAL-WHEN patches. Thank you, especially for the patch
to the IR1 transform. I suspect it would've taken me a long time to
understand that problem well enough to fix it.)
On Sat, Sep 01, 2001 at 09:37:11PM +0200, Martin Atzmueller wrote:
> Attached is a patch for defclass, preventing bogus warnings about
> redefining class-predicates in the interpreter.
> EXPAND-DEFCLASS now uses an (EVAL-WHEN (:COMPILE-TOPLEVEL) ...)
> in the macroexpansion to inform the compiler about the type
> predicate, which conforms fully to CLHS DEFCLASS entry.
> The type predicate is established in the compile-time environment,
> if the defclass happens at top-level.
I still think it's wrong to do EVAL at macroexpansion time, so I
don't think this patch is quite right. I'm afraid that weird cases
(defstruct predword () p r e d)
(defun pathologicality (x) ; admittedly not a particularly sane thing to do
(defclass predword () (y e s))
(defclass predword () (n o))))
(typep (make-predword) 'predword)
might give bogus results because of the macroexpansion-time side
effects. (I'm not sure whether this actual code would exhibit the
problem with this patch, since I didn't actually apply the patch. But
I'm pretty sure that similar code could be constructed to cause
I've tried rewriting the DEFCLASS code to use EVAL-WHENs to have
similar effects (in the version just checked in as sbcl-0.pre7.30).
I'm not sure I got it right either, so please let me know if you see
By the way if any PCL wizard reading this (or any PCL wizard-wannabe
for that matter:-) could tell me whether the DEFSTRUCT-P path through
DEFCLASS is reachable from ANSI code, or from
art-of-the-metaobject-protocol code; and if so, how to reach it, I'd
be obliged. I've had some trouble figuring out what it's for.
William Harold Newman <william.newman@...>
pending patches from sbcl-devel:
* MNA "cleanups" patch yet
* Alexey Dejneka's WRITE-STRING patch
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C