X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=mop.lisp;h=9e6eee67d4f789a82b2a3990c507418ac65a72ae;hb=a7e672d93f25a1a62977ae672e93bb75da1651fc;hp=b443aa0930057dfe9c3da7f172ffd6479bb5960b;hpb=409c40b1221545d7230f6e812921d441ba2d5f89;p=hyperobject.git diff --git a/mop.lisp b/mop.lisp index b443aa0..9e6eee6 100644 --- 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.35 2003/03/31 14:15:07 kevin Exp $ +;;;; $Id: mop.lisp,v 1.43 2003/04/12 03:37:52 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; @@ -281,7 +281,11 @@ (setf (slot-value ,the-instance ,the-slot-name) (,reader ,@keys))))) -#+(or sbcl scl cmu) +#+lispworks +(defun intern-eql-specializer (slot) + `(eql ,slot)) + +#+(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))) @@ -292,9 +296,16 @@ (make-method-lambda gf (class-prototype (generic-function-method-class gf)) + #-lispworks `(lambda (the-class the-instance the-slot-name) (declare (ignore the-class)) (setf (slot-value the-instance the-slot-name) (,reader ,@keys))) + #+lispworks + '(the-class the-instance the-slot-name) + #+lispworks + nil + #+lispworks + `(setf (slot-value the-instance the-slot-name) (,reader ,@keys)) nil) (add-method gf (apply @@ -322,17 +333,21 @@ nil (cdr subobj-def))))) (unless (eq (lookup subobject) t) - #-(or sbcl cmu scl) + #-(or sbcl cmu lispworks) (eval `(hyperobject::def-lazy-reader ,(name-class subobject) ,(name-slot subobject) ,(lookup subobject) ,@(lookup-keys subobject))) - #+(or sbcl cmu scl) + #+(or sbcl cmu lispworks) (apply #'ensure-lazy-reader (name-class subobject) (name-slot subobject) (lookup subobject) (lookup-keys subobject)) ) (push subobject subobjects)))) - subobjects))) + ;; sbcl/cmu reverse class-slots compared to the defclass form + ;; subobject is already reversed from the dolist/push loop, so re-reverse on cmu/sbcl + #+(or cmu sbcl) subobjects + #-(or cmu sbcl) (nreverse subobjects) + ))) (defun finalize-documentation (cl) "Calculate class documentation slot" @@ -370,6 +385,9 @@ :lookup it :link-parameters (slot-value esd 'hyperlink-parameters)) hyperlinks))) + ;; cmu/sbcl reverse class-slots compared to the defclass form + ;; hyperlinks is already reversed from the dolist/push loop, so re-reverse on sbcl/cmu + #-(or cmu sbcl) (setq hyperlinks (nreverse hyperlinks)) (setf (slot-value cl 'hyperlinks) hyperlinks))) (defun init-hyperobject-class (cl) @@ -401,6 +419,8 @@ (defun hyperobject-class-hyperlinks (obj) (hyperlinks (class-of obj))) -(defun hyperobject-class-fields (obj) - (class-slots (class-of obj))) +(defun hyperobject-class-slots (obj) + ;; cmucl/sbcl reverse class-slots + #+(or cmu sbcl) (reverse (class-slots (class-of obj))) + #-(or cmu sbcl) (class-slots (class-of obj)))