[elephant-devel] Committing some changes to the HEAD...

Robert L. Read read at robertlread.net
Wed Mar 1 18:58:25 UTC 2006


The following changes make me all green, even after repeated test runs,
even on databases that are fresh, under SBCL 9.9 under Linux, under
both SQL and BDB.

In serializer.lisp, this code is needed:
>           ;; This circumlocution is necessitated by
>           ;; an apparent bug in SBCL 9.9 --- type-of sometimes
>           ;; does NOT return the "proper name" of the class as the
>           ;; CLHS says it should, but gives the class object itself,
>           ;; which cannot be directly serialized....
>           (let ((tp (type-of frob)))
>             #+(or sbcl)
>             (if (not (symbolp tp))
>                 (setf tp (class-name (class-of frob))))
>             (%serialize tp))
>             )


Additionally, I had to change the idiom in the tests to handle the case
that the persistent classes exist in the DB from a previous test run,
but have not yet been even defined as classes in the LISP object space.
For example, in indexing-reconnect-db:

     (when (class-indexedp-by-name 'idx-five)
	(defclass idx-five ()
	  ((slot1 :initarg :slot1 :initform 1 :accessor slot1 :index t)
	   (slot2 :initarg :slot2 :initform 2 :accessor slot2)
	   (slot3 :initarg :slot3 :initform 3 :accessor slot3 :index t))
	  (:metaclass persistent-metaclass))
	(disable-class-indexing 'idx-five :errorp nil)
	(setf (find-class 'idx-five) nil))
      
      (defclass idx-five ()
	((slot1 :initarg :slot1 :initform 1 :accessor slot1 :index t)
	 (slot2 :initarg :slot2 :initform 2 :accessor slot2)
	 (slot3 :initarg :slot3 :initform 3 :accessor slot3 :index t))
	(:metaclass persistent-metaclass))

which is really hideous, handles the problem and makes the test 
correctly idempotent under all circumstances.

I suspect Ian Eslick may have some way of simplifying this last bit;
when he comes up for air from his current work we will discuss it.

AFAIK, the latest release now awaits only addition tests on other (non
SBCL/Linux)
systems and the documentation of the class indexing that I have promised
to Ian
but not yet written.

----
Robert L. Read, PhD                                     read &T
robertlread.net
Consider visiting Progressive Engineering:
http://robertlread.net/pe
In Austin: 912-8593                                        "Think
globally, Act locally." -- RBF


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20060301/1d0bb1db/attachment.html>


More information about the elephant-devel mailing list