Hello Bob,

On Thu, May 1, 2008 at 5:52 PM, Robert Brown <brown@google.com> wrote:
I tried to get CLPython up and running on the latest SBCL.  The diff below
contains a couple of easy fixes.  SBCL wants BREAK's argument to be a string
and SBCL's LOOP does not like a negative loop increment.

Thanks for the patches!
 
The real porting problem right now is CLOS related.  SBCL does not like the
following code in core/classes.lisp:

   ;; Fix superclass and metaclass of PY-DICT.
   (ensure-class 'py-dict
                 :direct-superclasses (list 'py-core-object)
                 :metaclass 'py-core-type)

I get the following error:

   debugger invoked on a SB-PCL::METAOBJECT-INITIALIZATION-VIOLATION in thread
   #<THREAD "initial thread" {11701A79}>:
     Cannot CHANGE-CLASS objects into CLASS metaobjects.
   See also:
     AMOP, Initialization of Class Metaobjects

I think the problem is that PY-DICT is a normal class and the ENSURE-CLASS
call tries to turn it into a metaclass.  Anyway, I'm far from a CLOS expert.

Well, class py-dict is not turned into a metaclass here, at least that's not the intention. :) The superclass and metaclass of it are changed but py-dict remains a non-metaclass class. So I think the actual error message is incorrect, but something else is wrong.

The problem might be that you can not change the metaclasses of a class using ensure-class. Could you please check if the call to ensure-class without the metaclass change is accepted?

(ensure-class 'py-dict
                    :direct-superclasses (list 'py-core-object))

Thanks,
- Willem