Hi, elephant

Currently Elephant 1.0 still cannot compile on LispWorks 5.1, the only blocking definition is this one:

(defmethod shared-initialize :around ((instance cacheable-persistent- object) slot-names &key make-cached-instance &allow-other-keys)
  ;; User asked us to start in cached mode?  Otherwise default to not.
  (setf (slot-value instance 'pchecked-out) make-cached-instance)
  (setf (slot-value instance 'checked-out) make-cached-instance)
  (call-next-method))

Error message:

**++++ Error in (METHOD
                 SHARED-INITIALIZE
                 :AROUND
                 (ELEPHANT::CACHEABLE-PERSISTENT-OBJECT T)):
Error during finalization of class #<PERSISTENT-METACLASS CACHEABLE- PERSISTENT-OBJECT 21869D3B>: Dynamic-Slot-Boundp-Using-Slotd is not defined for slot PCHECKED-OUT in #<CACHEABLE-PERSISTENT-OBJECT oid:NIL>

I found a way to get pass this issue: moving above definition out of "class.lisp", to, i.e. "cache.lisp", then everythings go fine. I run some BDB tests, seems OK.

I don't know why.

Attachment: ele-lw51.diff
Description: Binary data




--binghe

Hi, Larry

I just checked, Elephant 1.0 on my LWL64 5.0.2 can be compiled and loaded correctly. LWL64 5.1.2 failed on classes.lisp which you met.

In src/elephant/metaclasses.lisp, I found two definitions which mentioned about LispWorks versions:

line 396:

#+(or :lispworks3 :lispworks4 (and :lispworks5 :lispworks5.0))
(defmethod (setf slot-definition-allocation) (allocation (slot-def persistent-slot-definition))
 (unless (eq allocation :database)
(error "Invalid allocation type ~A for slot-definition- allocation" allocation))
 allocation)

line 587:

#+lispworks
(defmethod (setf slot-definition-allocation) (allocation (slot-def persistent-slot-definition))
 (unless (eq allocation :database)
(error "Invalid allocation type ~A for slot-definition- allocation" allocation))
 allocation)

The error output you saw, is reported by the second method definition above, I believe. I don't know much about Elephant, but I think above two method should both be disabled in LispWorks 5.1, which confirms "slot-definition changes for AMOP compatibility" in LW5.1:

http://www.lispworks.com/documentation/lw51/RNIG/html/readme-364.htm#pgfId-918212

<elephant-lw51-1.diff>


With my trivial patch, I go further:

;;; Compiling file /mnt/hgfs/Lisp/packages/elephant-1.0/src/elephant/ classes.lisp ...
;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 0
;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3
;;; Source level debugging is on
;;; Source file recording is  on
;;; Cross referencing is on
; (TOP-LEVEL-FORM 0)
; (TOP-LEVEL-FORM 1)
; (DEFVAR ELEPHANT::*DEBUG-SI*)
; (METHOD INITIALIZE-INSTANCE :BEFORE (ELEPHANT:PERSISTENT))
; ELEPHANT::INITIAL-PERSISTENT-SETUP
; ELEPHANT::REGISTER-NEW-INSTANCE
; ELEPHANT::CHECK-VALID-STORE-CONTROLLER
; (DEFCLASS ELEPHANT:PERSISTENT-COLLECTION)
; (DEFCLASS ELEPHANT:PERSISTENT-OBJECT)
; (DEFCLASS ELEPHANT::CACHEABLE-PERSISTENT-OBJECT)
; (METHOD SHARED-INITIALIZE :AROUND (ELEPHANT:PERSISTENT-METACLASS T))
; ELEPHANT::ENSURE-CLASS-INHERITS-FROM
; ELEPHANT::SUPERCLASS-MEMBER-P
; ELEPHANT::HAS-CACHED-SLOT-SPECIFICATION
; (METHOD
  CLOS:FINALIZE-INHERITANCE
  :AFTER
  (ELEPHANT:PERSISTENT-METACLASS))
; ELEPHANT::COMPUTE-DERIVED-INDEX-TRIGGERS
; (METHOD REINITIALIZE-INSTANCE :AROUND (ELEPHANT:PERSISTENT- METACLASS))
; ELEPHANT::BIND-SLOT-DEFS
; ELEPHANT::COMPUTE-BINDINGS
; (METHOD INITIALIZE-INSTANCE :AROUND (ELEPHANT:PERSISTENT-OBJECT))
; (METHOD SHARED-INITIALIZE :AROUND (ELEPHANT:PERSISTENT-OBJECT T))

**++++ Error in (METHOD
                SHARED-INITIALIZE
                :AROUND
                (ELEPHANT::CACHEABLE-PERSISTENT-OBJECT T)):
Error during finalization of class #<PERSISTENT-METACLASS CACHEABLE- PERSISTENT-OBJECT 4050351AFB>: Dynamic-Slot-Boundp-Using-Slotd is not defined for slot PCHECKED-OUT in #<CACHEABLE-PERSISTENT-OBJECT oid:NIL>
; ELEPHANT::INITIALIZE-PERSISTENT-SLOTS
; ELEPHANT::INITIALIZE-SET-SLOTS
; ELEPHANT::INITIALIZE-FROM-INITARG
; ELEPHANT::GET-INIT-SLOTNAMES
; (SUBFUNCTION
  (DEFCLASS ELEPHANT:DROPPING-PERSISTENT-SLOT-DATA)
  (DEFINE-CONDITION ELEPHANT:DROPPING-PERSISTENT-SLOT-DATA))
; (DEFINE-CONDITION ELEPHANT:DROPPING-PERSISTENT-SLOT-DATA)
; (DEFINE-CONDITION ELEPHANT:DROPPING-PERSISTENT-SLOT-DATA)
; ELEPHANT::WARN-ABOUT-DROPPED-SLOTS
; (METHOD ELEPHANT::RECREATE-INSTANCE-USING-CLASS (T))
; (DEFGENERIC ELEPHANT::RECREATE-INSTANCE)
; (METHOD ELEPHANT::RECREATE-INSTANCE (ELEPHANT:PERSISTENT-OBJECT))
; (METHOD ELEPHANT::RECREATE-INSTANCE (ELEPHANT:PERSISTENT- COLLECTION))
; (METHOD
  UPDATE-INSTANCE-FOR-REDEFINED-CLASS
  :AROUND
  (ELEPHANT:PERSISTENT-OBJECT T T T))
; (METHOD CHANGE-CLASS :BEFORE (ELEPHANT:PERSISTENT STANDARD-CLASS))
; (METHOD
  UPDATE-INSTANCE-FOR-DIFFERENT-CLASS
  :AFTER
  (ELEPHANT:PERSISTENT-OBJECT ELEPHANT:PERSISTENT-OBJECT))
; (METHOD
  CHANGE-CLASS
  :BEFORE
  (STANDARD-OBJECT ELEPHANT:PERSISTENT-METACLASS))
; (METHOD
  CLOS:SLOT-VALUE-USING-CLASS
  (ELEPHANT:PERSISTENT-METACLASS
   ELEPHANT:PERSISTENT-OBJECT
   ELEPHANT::PERSISTENT-SLOT-DEFINITION))
; (METHOD
  (SETF CLOS:SLOT-VALUE-USING-CLASS)
  (T
   ELEPHANT:PERSISTENT-METACLASS
   ELEPHANT:PERSISTENT-OBJECT
   ELEPHANT::PERSISTENT-SLOT-DEFINITION))
; (METHOD
  CLOS:SLOT-BOUNDP-USING-CLASS
  (ELEPHANT:PERSISTENT-METACLASS
   ELEPHANT:PERSISTENT-OBJECT
   ELEPHANT::PERSISTENT-SLOT-DEFINITION))
; (METHOD
  CLOS:SLOT-BOUNDP-USING-CLASS
  (ELEPHANT:PERSISTENT-METACLASS ELEPHANT:PERSISTENT-OBJECT SYMBOL))
; (METHOD
  CLOS:SLOT-MAKUNBOUND-USING-CLASS
  (ELEPHANT:PERSISTENT-METACLASS
   ELEPHANT:PERSISTENT-OBJECT
   ELEPHANT::PERSISTENT-SLOT-DEFINITION))
; ELEPHANT::VALID-PERSISTENT-REFERENCE-P
; (SUBFUNCTION
  (DEFCLASS ELEPHANT:CROSS-REFERENCE-ERROR)
  (DEFINE-CONDITION ELEPHANT:CROSS-REFERENCE-ERROR))
; (DEFINE-CONDITION ELEPHANT:CROSS-REFERENCE-ERROR)
; (DEFINE-CONDITION ELEPHANT:CROSS-REFERENCE-ERROR)
; ELEPHANT::SIGNAL-CROSS-REFERENCE-ERROR
; (METHOD
  CLOS:SLOT-VALUE-USING-CLASS
  (ELEPHANT:PERSISTENT-METACLASS ELEPHANT:PERSISTENT-OBJECT T))
; (METHOD
  (SETF CLOS:SLOT-VALUE-USING-CLASS)
  (T ELEPHANT:PERSISTENT-METACLASS ELEPHANT:PERSISTENT-OBJECT T))
; (METHOD
  CLOS:SLOT-MAKUNBOUND-USING-CLASS
  (ELEPHANT:PERSISTENT-METACLASS ELEPHANT:PERSISTENT-OBJECT T))
; (TOP-LEVEL-FORM 0)
; *** 1 error detected, no fasl file produced.

I think above compile error should be fixed by a simple patch, but I don't know how to fix it. Hope other guys better than me can help us go further.

There're some MOP differences between LispWorks 5.1 and early versions which mentioned in LW5.1 release notes:

http://www.lispworks.com/documentation/lw51/RNIG/html/readme-362.htm#pgfId-917070

Regards,

Chun Tian (binghe)

On 2009-2-3, at 09:41, Larry Clapp wrote:

Is there anything I can do to improve on the below error report?  I'd
like to use elephant but it doesn't compile on Lispworks for Linux
5.1.  Am I missing something?  Any help appreciated.

-- Larry

----- Forwarded message from Larry Clapp <la...@theclapp.org> -----

From: Larry Clapp <la...@theclapp.org>
Date: Sun, 25 Jan 2009 16:30:36 -0500
To: elephant-devel@common-lisp.net
Subject: Elephant won't compile under Lispworks for Linux 5.1

This appears to be similar to the error reported back in April 08
(http://common-lisp.net/pipermail/elephant-devel/2008-April/003925.html ).

Search below for "++++ Error".

-- Larry


CL-USER 1 > (asdf :elephant)
; loading system definition from /home/lmc/lisp/systems/ elephant.asd into
[snip]
; Loading fasl file /home/lmc/lisp/elephant/elephant-1.0/src/ elephant/metaclasses.ufasl ;;; Compiling file /home/lmc/lisp/elephant/elephant-1.0/src/ elephant/classes.lisp ...
;;; Safety = 1, Speed = 3, Space = 1, Float = 1, Interruptible = 0
;;; Compilation speed = 0, Debug = 3, Fixnum safety = 3
;;; Source level debugging is on
;;; Source file recording is  on
;;; Cross referencing is on
; (TOP-LEVEL-FORM 0)
; (TOP-LEVEL-FORM 1)
; (DEFVAR ELEPHANT::*DEBUG-SI*)
; (METHOD INITIALIZE-INSTANCE :BEFORE (ELEPHANT:PERSISTENT))
; ELEPHANT::INITIAL-PERSISTENT-SETUP
; ELEPHANT::REGISTER-NEW-INSTANCE
; ELEPHANT::CHECK-VALID-STORE-CONTROLLER
; (DEFCLASS ELEPHANT:PERSISTENT-COLLECTION)
; (DEFCLASS ELEPHANT:PERSISTENT-OBJECT)

**++++ Error in (DEFCLASS ELEPHANT::CACHEABLE-PERSISTENT-OBJECT):
Invalid allocation type INSTANCE for slot-definition-allocation
; (METHOD SHARED-INITIALIZE :AROUND (ELEPHANT:PERSISTENT-METACLASS T))
[snip]

----- End forwarded message -----

_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel

--
Chun Tian (binghe)
NetEase.com, Inc.
P. R. China


_______________________________________________
elephant-devel site list
elephant-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/elephant-devel

Reply via email to