m2ym / optima

Optimized Pattern Matching Library for Common Lisp
268 stars 19 forks source link

When Loading MOP, class-pattern complains the class is not yet finalized #96

Closed guicho271828 closed 10 years ago

guicho271828 commented 10 years ago

on sbcl

SB-MOP:CLASS-SLOTS called on #<STANDARD-CLASS CLASSICAL-PLANNING-NODE>, which is not yet finalized.
   [Condition of type SB-INT:SIMPLE-REFERENCE-ERROR]
See also:
  The Art of the Metaobject Protocol, CLASS-SLOTS [:generic-function]
m2ym commented 10 years ago

How can I get the warning?

guicho271828 commented 10 years ago

not sure... sometimes do and sometimes not. if i put finslize-inheritance it stop complaining, so basically not a big issue. none of the parents is the forward-referenced class, so this is curious.

m2ym commented 10 years ago

Do you mean by "i put finslize-inheritance it stop complaining" that putting finalize-inheritance of class-pattern at the end of file of optima package solves the issue?

scymtym commented 10 years ago

I saw this problem in a situation like this (on SBCL):

(defclass foo () ())
(match nil ((foo :bar) :class))

macroexpanding leads to

SB-MOP:CLASS-SLOTS called on #<STANDARD-CLASS FOO>, which is not yet finalized.

Doing (sb-mop:finalize-inheritance (find-class 'foo)) prior to calling class-slots fixes it.