[cells-devel] Added an eval-now! to defmodel to suppress SBCL warnings

Ken Tilton kennytilton at optonline.net
Wed May 21 11:36:12 UTC 2008


Peter Hildebrandt wrote:
> SBCL kept bugging me with style-warnings when compiling
> defmd/defmodels for the first time.  Wrapping the defclass part of
> defmodel in an eval-now! fixes it nicely:
> 
>      ; -------  defclass ---------------  (^slot-value ,model ',',slotname)
>      (eval-now! ;; suppress style warning in SBCL, ph
>        (prog1
> 	  (defclass ,class ,(or directsupers '(model-object)) ;; now we can
> def the class
> 
> 
> I committed that to CVS today.  Lemme know whether anything breaks.

Cool, I have been meaning to track that down, I get it, too, with ACL.

I believe I reintroduced relativley recently when I casually switched to 
prog1 to get the class returned by defmodel, instead of using progn and 
then ending with find-class on the new class, just cuz prog1 seemed more 
elegant.

Probably a better fix would be to refactor so any (^macros) (which is 
where I get my warnings, when they appear in rules supplied as defaults 
with the class definition) are defined first so they will be available:

(progn <define macros> (prog1 <define class> <define methods on class))

As it is, I believe (not checking) I have one helper macro that does it 
all for a slot, so has the problem of needing to appear both before and 
after the defclass. oops.

Another thing I want to do is change those (^macros) to be ^macros 
(symbol macros expanding to the same thing) now that they are 
zero-argument macros -- they once were much different beasts.

Anyway, I have an app to write, this interim patch is fine.

Thx,

kt

ps. What /were/ the style warnings? k




More information about the cells-devel mailing list