r3461: *** empty log message ***
[hyperobject.git] / example.lisp
index 75ef3f7baef8e6d0e804acfa78c892a97b456a13..39a884be6bae84599fbb1a39aa90439d7efaf347 100644 (file)
@@ -9,7 +9,7 @@
 ;;;;
 ;;;; A simple example file for hyperobjects
 ;;;;
-;;;; $Id: example.lisp,v 1.4 2002/11/22 19:48:49 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
 ;;;;
 
 
 (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"))
 
                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))