[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Save-object patches, version 7a(alpha)



Users of save-object might be interested in the comments below I
sent to Luke Hohmann. The current alpha version of save-object is
labelled '7a(alpha)': about sixteen testers including Luke are
working with it: 7b will contain these patches. If you would like
to look at save-object 7alpha, send me an email and I will mail you
the code. Thanks! kerry@ads.com

Hi Luke:
I say your query about save object on comp.lisp.lang.mcl:
below I think you'll find some of the solutions. 

1. get-defstruct-slotnames not defined.
This should fix it, (insert after get-defstruct-slots definition in
the MCL DEFSTRUCT eval-when):

(setf (symbol-function 'get-defstruct-slotnames) #'get-defstruct-slots)

2. undefined functions in CCL:

This is probably a flag problem, you dont seem to have:

 ccl::compiled-function-name

try (apropos 'function-name) to come up with an equivalent in
your version of MCL, substitute this name for ccl::compiled-function-name
globally throughout the save object file (there should only be one occurence)

 ccl::class-direct-slots

Try (fboundp 'clos::class-direct-class-slots): if t,
use the second definition below, or find the equivalent function in
your version with (apropos 'direct-slots 'ccl), and substitute.

#-mcl2.0f3
(defun CLASS-DIRECT-SLOTS (class)
"Given a class object return the slot objects."
(ccl::class-direct-slots class))

#+mcl2.0f3
(defun CLASS-DIRECT-SLOTS (class)
"Given a class object return the slot objects."
(ccl::class-direct-class-slots class))

3. Undefined function CLASSP.

This function should already be there:

(defun %CLASSP (X)
"predicate to tell if something is a class object."
(typep x 'ccl::standard-class))

Or alternately try (apropos 'classp) and find an equivalent
function in your version, and do something like:

(defun %CLASSP (X)
(ccl::classp x)) ;;; or whatever it happens to be called.

Then do:

(setf (symbol-function 'classp) #'%classp)

4. General flag difficulties and problems:

? (db:save-object foo "test")
> Error: Can't take CAR of "MODIFIED: Given a class object, return all the slot objects.".
> While executing: #<standard-method database::all-slotnames (t)>
> Type Command-. to abort.
See the RestartsI menu item for further choices.

This is happing in the function CLASS-SLOTS:

#|
(defun CLASS-SLOTS (class)
"MODIFIED: Given a class object, return all the slot objects."
#+supra (ccl::class-instance-slots class)
#+fx (ccl::class-slots class)
#+mcl2.0f3(class-direct-slots class)
)
|#

(defun CLASS-SLOTS (class)
"MODIFIED: Given a class object, return all the slot objects."
#+supra (ccl::class-instance-slots class)
;#+fx (ccl::class-slots class)
;#+mcl2.0f3(class-direct-slots class)
;; modified by KJ
#+mcl2.0f3(ccl::class-instance-slots class)
)

This means that none of the '#+' conditions are being met, and the
documentation string is being returned! Take a look at the directions
at the head of the file, you should have:

Directions:
-----------

(0) SPECIAL DIRECTIONS FOR USERS OF MCL2.0f3:
    ADD THE FOLLOWING LINE TO THE TOP OF YOUR FILE:
    (pushnew :mcl2.0f3 *features*)

and later:
(This really applies to all post-beta 2.0 versions)

;;;; Uncomment the following line if using mcl2.0f3....
;;;(PUSHNEW :mcl2.0f3 *features*)
(pushnew :clos *features*) ;;; MCL has clos, but it isnt in the features list...

Try these out and let me know how it works out: I'm very interested in
the new MCL versions since I no longer have access to MCL here. I'll
incoporate these changes into the alpha code version I'm working on:
Its labeled version '7B'.

thanks, kerry