;;;;
;;;; $Id$
;;;;
-;;;; This file is Copyright (c) 2000-2003 by Kevin M. Rosenberg
+;;;; This file is Copyright (c) 2000-2006 by Kevin M. Rosenberg
;;;; *************************************************************************
(in-package #:hyperobject)
t)
(defmethod finalize-inheritance :after ((cl hyperobject-class))
- ;; Work-around needed for OpenMCL
- #+ignore
- (unless (find-class (class-name cl))
- (setf (find-class (class-name cl)) cl))
-
- (init-hyperobject-class cl)
- )
+ (init-hyperobject-class cl))
(eval-when (:compile-toplevel :load-toplevel :execute)
(when (>= (length (generic-function-lambda-list
3)
(pushnew :ho-normal-esdc cl:*features*)))
-;; Slot definitions
(defmethod direct-slot-definition-class ((cl hyperobject-class)
#+ho-normal-dsdc &rest iargs)
+ (declare (ignore iargs))
(find-class 'hyperobject-dsd))
(defmethod effective-slot-definition-class ((cl hyperobject-class)
#+ho-normal-esdc &rest iargs)
+ (declare (ignore iargs))
(find-class 'hyperobject-esd))
-
;;; Slot definitions
(eval-when (:compile-toplevel :load-toplevel :execute)
(t
t)))
+(defmethod initialize-instance :around ((obj hyperobject-dsd) &rest initargs)
+ (do* ((parsed (list obj))
+ (name (first initargs) (first initargs))
+ (val (second initargs) (second initargs)))
+ ((null initargs)
+ (apply #'call-next-method parsed))
+ (if (eql name :value-type)
+ (progn
+ (setq val (canonicalize-value-type val))
+ (setq parsed (append parsed (list name val)))
+ (setq parsed (append parsed (list :type
+ (value-type-to-lisp-type
+ (canonicalize-value-type val))))))
+ (setq parsed (append parsed (list name val))))
+ (setq initargs (cddr initargs))))
+
(defmethod compute-effective-slot-definition :around ((cl hyperobject-class)
#+ho-normal-cesd name
dsds)
esd)))
(defun compute-hyperobject-esd (esd dsds)
- (let* ((dsd (car dsds))
- (value-type (canonicalize-value-type (slot-value dsd 'value-type))))
+ (let* ((dsd (car dsds)))
(multiple-value-bind (sql-type sql-length)
- (value-type-to-sql-type value-type)
+ (value-type-to-sql-type (dsd-value-type dsd))
(setf (esd-sql-type esd) sql-type)
(setf (esd-sql-length esd) sql-length))
- (setf (slot-value esd #-sbcl 'type
- #+sbcl 'sb-pcl::%type)
- (value-type-to-lisp-type value-type))
- (setf (esd-value-type esd) value-type)
(setf (esd-user-name esd)
(aif (dsd-user-name dsd)
- it
+ it
(string-downcase (symbol-name (slot-definition-name dsd)))))
(setf (esd-sql-name esd)
(aif (dsd-sql-name dsd)
(aif (dsd-sql-name dsd)
it
(lisp-name-to-sql-name (slot-definition-name dsd))))
- (dolist (name '(print-formatter subobject hyperlink hyperlink-parameters
+ (dolist (name '(value-type print-formatter subobject hyperlink
+ hyperlink-parameters unbound-lookup
description value-constraint indexed null-allowed
unique short-description void-text read-only-groups
hidden-groups unit disable-predicate view-type
;; is also returned.
(defun ensure-lazy-reader (cl class-name slot-name subobj-class reader
&rest reader-keys)
+ (declare (ignore class-name))
(setf (getf (gethash cl *lazy-readers*) slot-name)
(aif subobj-class
it