> I am using Weblocks (stable) with CLSQL on LispWorks Professional
> 5.1.2. Trying to load clsql-fluid (from the git repository) fails,
> though (see ** LispWorks error & backtrace below).
>
> I have almost no MOP knowledge (yet), but I can duplicate LispWorks'
> error in SBCL with the following (see * SBCL error & backtrace below),
> which gives a better description of the error.

The piece you are missing is a method on `validate-superclass'.  See the
AMOP docs for details.

> The class #<STANDARD-CLASS FOO> was specified as a super-class
> of the class #<BAR BAZ>, but the meta-classes
> #<STANDARD-CLASS STANDARD-CLASS> and #<STANDARD-CLASS BAR> are
> incompatible.  Define a method for SB-MOP:VALIDATE-SUPERCLASS to
> avoid this error.
>    [Condition of type SIMPLE-ERROR]

As mentioned here.

> **++++ Error in (DEFCLASS CLSQL-SYS:FLUID-DATABASE):
>   #<STANDARD-CLASS DATABASE 217B30A3> is an invalid superclass of
> #<SUB-DB-FORWARDING-CLASS FLUID-DATABASE 22149AE7>.
> ;;;*** Warning in (METHOD INITIALIZE-INSTANCE :AFTER
> (CLSQL-SYS:FLUID-DATABASE)): Ignoring type declaration with illegal
> type CLSQL-SYS:FLUID-DATABASE

The problem may be that Lispworks wants to call validate-superclass when
compiling defclass or defgeneric.  I define a VS method in the file
before those forms, but it is of course not evalled and added to the GF
until actually loading.  Would you try this patch and let me know
whether it helps?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

diff --git a/sql/fluid.lisp b/sql/fluid.lisp
index 26494b8..8a5a876 100644
--- a/sql/fluid.lisp
+++ b/sql/fluid.lisp
@@ -82,13 +82,14 @@ NEW-VALUE."
   ()
   (:documentation "Forward some slots to an underlying database."))
 
-(defmethod c2mop:validate-superclass ((class sub-db-forwarding-class) superclass)
-  "Allow standard-class, c2mop:standard-class, and myself."
-  (and (eql (class-of class) (find-class 'sub-db-forwarding-class))
-       (loop with scc = (class-of superclass)
-	     for ccname in '(standard-class c2mop::standard-class
-			     sub-db-forwarding-class)
-	     thereis (eql scc (find-class ccname)))))
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (defmethod c2mop:validate-superclass ((class sub-db-forwarding-class) superclass)
+    "Allow standard-class, c2mop:standard-class, and myself."
+    (and (eql (class-of class) (find-class 'sub-db-forwarding-class))
+	 (loop with scc = (class-of superclass)
+	       for ccname in '(standard-class c2mop::standard-class
+			       sub-db-forwarding-class)
+	       thereis (eql scc (find-class ccname))))))
 
 (defmethod c2mop:slot-value-using-class
     ((class sub-db-forwarding-class) inst slot-def)
-- 
Sorry but you say Nibiru is a Hoax?  Doesnt Exist?  So maybe The
Sumerian people doesnt exist also! --Anonymous by way of SkI

Reply via email to