X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=inline;f=example.lisp;h=39a884be6bae84599fbb1a39aa90439d7efaf347;hb=13e3ab1f2045c54401aeebeb5eff49c55649fd27;hp=cc9883dd4cb7a9555e5631c805581da8209ec9ed;hpb=4bd7e3fad38f122bc3e1d93d523670fa124c73f0;p=hyperobject.git diff --git a/example.lisp b/example.lisp index cc9883d..39a884b 100644 --- a/example.lisp +++ b/example.lisp @@ -9,23 +9,24 @@ ;;;; ;;;; A simple example file for hyperobjects ;;;; -;;;; $Id: example.lisp,v 1.3 2002/11/22 19:14:17 kevin Exp $ +;;;; $Id: example.lisp,v 1.5 2002/11/23 18:41:45 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; ;;;; ************************************************************************* -(in-package :hyperobject-mop-user) +(in-package :hyperobject-user) (defclass person (hyperobject) - ((first-name :type string :initarg :first-name :reader first-name :initform nil) - (last-name :type string :initarg :last-name :reader last-name :initform nil + ((first-name :type string :initarg :first-name :reader first-name) + (last-name :type string :initarg :last-name :reader last-name :reference find-person-by-last-name) - (dob :type integer :initarg :dob :reader dob :initform 0 :format-func format-date) + (dob :type integer :initarg :dob :reader dob :print-formatter format-date) (resume :type cdata :initarg :resume :reader resume) - (addresses :initarg :addresses :reader addresses :initform nil :subobject t)) + (addresses :initarg :addresses :reader addresses :subobject t)) (:metaclass hyperobject-class) + (:default-initargs :first-name nil :last-name nil :dob 0 :resume nil) (:print-slots first-name last-name dob resume) (:title "Person")) @@ -42,10 +43,11 @@ hr min sec)))) (defclass address (hyperobject) - ((title :type string :initarg :title :reader title :initform nil) - (street :type string :initarg :street :reader street :initform nil) - (phones :initarg :phones :reader phones :initform nil :subobject t)) + ((title :type string :initarg :title :reader title) + (street :type string :initarg :street :reader street) + (phones :initarg :phones :reader phones :subobject t)) (:metaclass hyperobject-class) + (:default-initargs :title nil :street nil) (:title "Address") (:print-slots title street)) @@ -53,6 +55,7 @@ ((phone-number :type string :initarg :phone-number :reader phone-number)) (:metaclass hyperobject-class) (:title "Phone Number") + (:default-initargs :phone-number nil) (:print-slots phone-number))