From aaef96a66c4f9913e88170f241a217a49078e9a9 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 29 Nov 2002 04:10:52 +0000 Subject: [PATCH] r3516: *** empty log message *** --- example-no-mop.lisp | 80 -------------------------------- example.lisp | 90 ------------------------------------ hyperobject.asd | 11 ++--- hyperobject.lisp => mop.lisp | 2 +- 4 files changed, 5 insertions(+), 178 deletions(-) delete mode 100644 example-no-mop.lisp delete mode 100644 example.lisp rename hyperobject.lisp => mop.lisp (99%) diff --git a/example-no-mop.lisp b/example-no-mop.lisp deleted file mode 100644 index f36fae2..0000000 --- a/example-no-mop.lisp +++ /dev/null @@ -1,80 +0,0 @@ -;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: hyperobject-plain-example.lisp -;;;; Purpose: Hyper Object Metaclass -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Apr 2000 -;;;; -;;;; This metaclass as functions to classes to allow display -;;;; in Text, HTML, and XML formats. This includes hyperlinking -;;;; capability and sub-objects. -;;;; -;;;; $Id: example-no-mop.lisp,v 1.1 2002/11/23 22:19:17 kevin Exp $ -;;;; -;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg -;;;; -;;;; ************************************************************************* - -(in-package :hyperobject-no-mop-user) - -(define-hyperobject person () - ((first-name :type string :reference find-person-by-last-name) - (last-name :type string) - (dob :type integer :initform 0 :print-formatter format-date) - (resume :type cdata) - (addresses :subobject t)) - (:title "Person") - (:documentation "Person hyperobject class")) - -(defun format-date (ut) - (when (typep ut 'integer) - (multiple-value-bind (sec min hr day mon year dow daylight-p zone) - (decode-universal-time ut) - (declare (ignore daylight-p zone)) - (format nil "~[Mon~;Tue~;Wed~;Thu~;Fri~;Sat~;Sun~], ~d ~[Jan~;Feb~;Mar~;Apr~;May~;Jun~;Jul~;Aug~;Sep~;Oct~;Nov~;Dec~] ~d ~2,'0d:~2,'0d:~2,'0d" - dow - day - (1- mon) - year - hr min sec)))) - -(define-hyperobject address () - ((title :type string) - (street :type string) - (phones :subobject t)) - (:title "Address") - (:documentation "Address hyperobject")) - -(define-hyperobject phone () - ((phone-number :type string)) - (:title "Phone Number") - (:documentation "Phone hyperobject")) - - -(defparameter home-phone-1 (make-instance 'phone :phone-number "367-9812")) -(defparameter home-phone-2 (make-instance 'phone :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 home (make-instance 'address :title "Home" :street "321 Shady Lane" - :phones (list home-phone-1 home-phone-2))) - -(defparameter office (make-instance 'address :title "Office" :street "113 Main St." - :phones (list office-phone-1 office-phone-2 office-phone-3))) - - -(defparameter mary (make-instance 'person :first-name "Mary" :last-name "Jackson" - :dob (get-universal-time) - :addresses (list home office) - :resume "Style & Grace")) - - -(format t "~&Text Format~%") -(print-hyperobject mary :subobjects t) - -(format t "~&XML Format with field labels and hyperlinks~%") -(print-hyperobject mary :subobjects t :label t :format :xmlref) diff --git a/example.lisp b/example.lisp deleted file mode 100644 index e16bba5..0000000 --- a/example.lisp +++ /dev/null @@ -1,90 +0,0 @@ -;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: hyperobject-example.lisp -;;;; Purpose: Hyperobject Example file -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Oct 2002 -;;;; -;;;; A simple example file for hyperobjects -;;;; -;;;; $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 -;;;; -;;;; ************************************************************************* - -(in-package :hyperobject-user) - - -(defclass person (hyperobject) - ((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 :print-formatter format-date) - (resume :type cdata :initarg :resume :reader resume) - (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") - (:description "A Person")) - -(defun format-date (ut) - (when (typep ut 'integer) - (multiple-value-bind (sec min hr day mon year dow daylight-p zone) - (decode-universal-time ut) - (declare (ignore daylight-p zone)) - (format nil "~[Mon~;Tue~;Wed~;Thu~;Fri~;Sat~;Sun~], ~d ~[Jan~;Feb~;Mar~;Apr~;May~;Jun~;Jul~;Aug~;Sep~;Oct~;Nov~;Dec~] ~d ~2,'0d:~2,'0d:~2,'0d" - dow - day - (1- mon) - year - hr min sec)))) - -(defclass address (hyperobject) - ((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) - (:description "An address")) - -(defclass phone (hyperobject) - ((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 :title nil :phone-number nil) - (:print-slots title phone-number) - (:description "A phone number")) - - -(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 :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))) - -(defparameter office (make-instance 'address :title "Office" :street "113 Main St." - :phones (list office-phone-1 office-phone-2 office-phone-3))) - - -(defparameter mary (make-instance 'person :first-name "Mary" :last-name "Jackson" - :dob (get-universal-time) - :addresses (list home office) - :resume "Style & Grace")) - - -(format t "~&Text Format~%") -(print-hyperobject mary :subobjects t) - -(format t "~&XML Format with field labels and hyperlinks~%") -(print-hyperobject mary :subobjects t :label t :format :xmlref) diff --git a/hyperobject.asd b/hyperobject.asd index 2e0bc22..e26fe0e 100644 --- a/hyperobject.asd +++ b/hyperobject.asd @@ -7,25 +7,22 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: hyperobject.asd,v 1.8 2002/11/25 04:47:23 kevin Exp $ +;;;; $Id: hyperobject.asd,v 1.9 2002/11/29 04:07:52 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; ************************************************************************* (in-package :asdf) +#+(or allegro lispworks sbcl cmu scl) (defsystem :hyperobject :perform (load-op :after (op hyperobject) (pushnew :hyperobject cl:*features*)) :components ((:file "package") - #+(or allegro lispworks sbcl cmu scl) - (:file "hyperobject" :depends-on ("package")) - #+(or allegro lispworks sbcl cmu scl) - (:file "views" :depends-on ("hyperobject")) - #+(or allegro lispworks sbcl cmu scl) + (:file "mop" :depends-on ("package")) + (:file "views" :depends-on ("mop")) (:file "base-class" :depends-on ("views")) - (:file "hyperobject-no-mop" :depends-on ("package")) ) :depends-on (:kmrcl)) diff --git a/hyperobject.lisp b/mop.lisp similarity index 99% rename from hyperobject.lisp rename to mop.lisp index 8f585f0..151baf2 100644 --- a/hyperobject.lisp +++ b/mop.lisp @@ -11,7 +11,7 @@ ;;;; in Text, HTML, and XML formats. This includes hyperlinking ;;;; capability and sub-objects. ;;;; -;;;; $Id: hyperobject.lisp,v 1.17 2002/11/26 21:51:10 kevin Exp $ +;;;; $Id: mop.lisp,v 1.1 2002/11/29 04:07:52 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; -- 2.34.1