r4447: Auto commit for Debian build
[hyperobject.git] / mop.lisp
index fb453ccf48517763129714902d309096b143451a..01ba7ade215e6c154c689884cd9072a4bfebe55b 100644 (file)
--- a/mop.lisp
+++ b/mop.lisp
@@ -11,7 +11,7 @@
 ;;;; in Text, HTML, and XML formats. This includes hyperlinking
 ;;;; capability and sub-objects.
 ;;;;
-;;;; $Id: mop.lisp,v 1.37 2003/04/03 23:58:15 kevin Exp $
+;;;; $Id: mop.lisp,v 1.42 2003/04/12 03:30:52 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
 ;;;;
 (defun intern-eql-specializer (slot)
   `(eql ,slot))
 
-#+(or sbcl scl cmu lispworks)
+#+(or sbcl cmu lispworks)
 (defun ensure-lazy-reader (class-name slot-name reader &rest reader-keys)
   (let ((keys nil)
        (gf (ensure-generic-function 'slot-unbound)))
        #+lispworks
        '(the-class the-instance the-slot-name)
        #+lispworks
-       '(declare (ignore the-class))
+       nil
        #+lispworks
-       '(setf (slot-value the-instance the-slot-name) (,reader ,@keys))
+       `(setf (slot-value the-instance the-slot-name) (,reader ,@keys))
        nil)
        (add-method gf
                    (apply
                                                           nil
                                                           (cdr subobj-def)))))
            (unless (eq (lookup subobject) t)
-             #-(or sbcl cmu scl lispworks)
+             #-(or sbcl cmu lispworks)
              (eval
               `(hyperobject::def-lazy-reader ,(name-class subobject)
                 ,(name-slot subobject) ,(lookup subobject)
                 ,@(lookup-keys subobject)))
-             #+(or sbcl cmu scl lispworks)
+             #+(or sbcl cmu lispworks)
              (apply #'ensure-lazy-reader 
                     (name-class subobject) (name-slot subobject) (lookup subobject) (lookup-keys subobject))
              )
            (push subobject subobjects))))
-      subobjects)))
+      ;; allegro and lispworks don't reverse class-slots compared to the defclass form
+      ;; subobject is already reversed from the dolist/push loop, so re-reverse on cmu/sbcl/scl
+      #+(or cmu sbcl scl) subobjects
+      #-(or cmu sbcl scl) (nreverse subobjects)
+    )))
 
 (defun finalize-documentation (cl)
   "Calculate class documentation slot"
                        :lookup it
                        :link-parameters (slot-value esd 'hyperlink-parameters))
         hyperlinks)))
+    ;; cmu/sbcl/scl reverse class-slots compared to the defclass form
+    ;; hyperlinks is already reversed from the dolist/push loop, so re-reverse on sbcl/scl/cmu
+    #-(or cmu sbcl scl) (setq hyperlinks (nreverse hyperlinks))
     (setf (slot-value cl 'hyperlinks) hyperlinks)))
 
 (defun init-hyperobject-class (cl)
   (hyperlinks (class-of obj)))
 
 (defun hyperobject-class-fields (obj)
-  (class-slots (class-of obj)))
+  ;; cmucl/sbcl/scl reverse class-slots
+  #+(or cmu sbcl scl) (reverse (class-slots (class-of obj)))
+  #-(or cmu sbcl scl) (class-slots (class-of obj)))