From: Kevin M. Rosenberg Date: Sat, 14 Dec 2002 21:52:48 +0000 (+0000) Subject: r3630: *** empty log message *** X-Git-Tag: debian-2.11.0-2~221 X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;h=5a20b2bd0d0859d58da60fd22ab37658673ef291;hp=715a81d8541f2191738f14d84c386c11d2822dd9;p=hyperobject.git r3630: *** empty log message *** --- diff --git a/examples/person.lisp b/examples/person.lisp index a91008b..fe6cbe7 100644 --- a/examples/person.lisp +++ b/examples/person.lisp @@ -9,7 +9,7 @@ ;;;; ;;;; A simple example file for hyperobjects ;;;; -;;;; $Id: person.lisp,v 1.5 2002/12/14 18:51:56 kevin Exp $ +;;;; $Id: person.lisp,v 1.6 2002/12/14 21:52:48 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; @@ -18,18 +18,18 @@ (in-package :hyperobject-user) (defclass person (hyperobject) - ((first-name :value-type (varchar 20) :initarg :first-name :reader first-name + ((first-name :value-type (varchar 20) :initarg :first-name :accessor first-name :value-constraint stringp :null-allowed nil) - (last-name :value-type (varchar 30) :initarg :last-name :reader last-name + (last-name :value-type (varchar 30) :initarg :last-name :accessor last-name :value-constraint stringp :hyperlink find-person-by-last-name :null-allowed nil) (full-name :value-type string :stored nil) - (dob :value-type integer :initarg :dob :reader dob :print-formatter format-date + (dob :value-type integer :initarg :dob :accessor dob :print-formatter format-date :value-constraint integerp :input-filter convert-to-date) - (resume :value-type string :initarg :resume :reader resume + (resume :value-type string :initarg :resume :accessor resume :value-constraint stringp) -;; (addresses :value-type (list-of subobject) :initarg :addresses :reader addresses)) - (addresses :subobject t :initarg :addresses :reader addresses)) +;; (addresses :value-type (list-of subobject) :initarg :addresses :accessor addresses)) + (addresses :subobject t :initarg :addresses :accessor addresses)) (:metaclass hyperobject-class) (:default-initargs :first-name "" :last-name "" :dob 0 :resume nil) (:default-print-slots first-name last-name dob resume) @@ -52,11 +52,11 @@ hr min sec)))) (defclass address (hyperobject) - ((title :value-type (varchar 20) :initarg :title :reader title + ((title :value-type (varchar 20) :initarg :title :accessor title :value-constraint stringp) - (street :value-type (varchar 30) :initarg :street :reader street + (street :value-type (varchar 30) :initarg :street :accessor street :value-constraint stringp) - (phones :subobject t :initarg :phones :reader phones)) + (phones :subobject t :initarg :phones :accessor phones)) (:metaclass hyperobject-class) (:default-initargs :title nil :street nil) (:user-name "Address") @@ -64,9 +64,9 @@ (:description "An address")) (defclass phone (hyperobject) - ((title :value-type (varchar 20) :initarg :title :reader title + ((title :value-type (varchar 20) :initarg :title :accessor title :value-constraint stringp) - (phone-number :value-type (varchar 16) :initarg :phone-number :reader phone-number + (phone-number :value-type (varchar 16) :initarg :phone-number :accessor phone-number :value-constraint stringp)) (:metaclass hyperobject-class) (:user-name "Phone Number") diff --git a/mop.lisp b/mop.lisp index 46d4514..496bc56 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.15 2002/12/14 18:51:56 kevin Exp $ +;;;; $Id: mop.lisp,v 1.16 2002/12/14 21:52:48 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; @@ -385,14 +385,13 @@ (defun compile-rule (source-code dependants volatile cl) (let ((access (appendnew dependants volatile))) -;; (compile nil + (compile nil (eval `(lambda (obj) (when (every #'(lambda (x) (slot-boundp obj x)) (quote ,dependants)) (with-slots ,access obj - ,@source-code)))))) -;;) + ,@source-code))))))) (defun finalize-rules (cl) (let* ((direct-rules (direct-rules cl)) @@ -417,9 +416,16 @@ (let ((name (slot-definition-name slot))) (dolist (rule (rules cl)) (when (find name (dependants rule)) - (cmsg "firing rule: ~a" rule) + (cmsg-c :debug "firing rule: ~W" (source-code rule)) (funcall (func rule) obj))))) + +#+ignore +(defmethod (setf slot-value-using-class) + :around (new-value (cl hyperobject-class) obj + (slot standard-effective-slot-definition)) + (call-next-method)) + (defmethod (setf slot-value-using-class) :around (new-value (cl hyperobject-class) obj (slot standard-effective-slot-definition))