X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=example.lisp;h=e16bba54835954ff78f905ec240ebbe67a40410e;hb=310528f335c81365343ca5503e4db4be062080a2;hp=39a884be6bae84599fbb1a39aa90439d7efaf347;hpb=e964aded44e186a93e1a3d963ffc447efe6368e4;p=hyperobject.git diff --git a/example.lisp b/example.lisp index 39a884b..e16bba5 100644 --- a/example.lisp +++ b/example.lisp @@ -9,7 +9,7 @@ ;;;; ;;;; A simple example file for hyperobjects ;;;; -;;;; $Id: example.lisp,v 1.5 2002/11/23 18:41:45 kevin Exp $ +;;;; $Id: example.lisp,v 1.6 2002/11/24 17:47:50 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; @@ -28,7 +28,8 @@ (: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")) + (:title "Person") + (:description "A Person")) (defun format-date (ut) (when (typep ut 'integer) @@ -49,22 +50,25 @@ (:metaclass hyperobject-class) (:default-initargs :title nil :street nil) (:title "Address") - (:print-slots title street)) + (:print-slots title street) + (:description "An address")) (defclass phone (hyperobject) - ((phone-number :type string :initarg :phone-number :reader phone-number)) + ((title :type string :initarg :title :reader title) + (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)) + (:default-initargs :title nil :phone-number nil) + (:print-slots title phone-number) + (:description "A phone number")) -(defparameter home-phone-1 (make-instance 'phone :phone-number "367-9812")) -(defparameter home-phone-2 (make-instance 'phone :phone-number "367-9813")) +(defparameter home-phone-1 (make-instance 'phone :title "Voice" :phone-number "367-9812")) +(defparameter home-phone-2 (make-instance 'phone :title "Fax" :phone-number "367-9813")) -(defparameter office-phone-1 (make-instance 'phone :phone-number "123-0001")) -(defparameter office-phone-2 (make-instance 'phone :phone-number "123-0002")) -(defparameter office-phone-3 (make-instance 'phone :phone-number "123-0005")) +(defparameter office-phone-1 (make-instance 'phone :title "Main line" :phone-number "123-0001")) +(defparameter office-phone-2 (make-instance 'phone :title "Staff line" :phone-number "123-0002")) +(defparameter office-phone-3 (make-instance 'phone :title "Fax" :phone-number "123-0005")) (defparameter home (make-instance 'address :title "Home" :street "321 Shady Lane" :phones (list home-phone-1 home-phone-2)))