[clsql-fluid-devel] clsql-fluid and LispWorks

Nico de Jager ndj at bitart.cc
Wed May 20 16:28:48 UTC 2009


Thank you, Stephen. clsql-fluid compiles and loads on LispWorks after
applying your patch. 

Regards.
Nico


Stephen Compall <s11 at member.fsf.org> writes:

> Nico De Jager <nicodnn at gmail.com> writes:
>> 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?
>
>
> 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)




More information about the clsql-fluid-devel mailing list