annotate conditions.lisp @ 18:70e76c1c87b7

Bug fixes and exports in package.lisp darcs-hash:20061213114049-f76cc-4c4175a1ad8b24e1c5df82c9fb67445ac32977d9.gz
author David Lewis <d.lewis@gold.ac.uk>
date Wed, 13 Dec 2006 11:40:49 +0000
parents cb470aecc3b0
children
rev   line source
m@3 1 (cl:in-package #:amuse)
m@3 2
m@2 3 ;; Some conditions we might want to be able to signal
m@2 4
m@2 5 (define-condition undefined-action (condition)
m@2 6 ;; This condition would apply to an attempt to perform a meaningless
m@2 7 ;; operation on an object. This may, initially, include things that
m@2 8 ;; are a pain to implement but should really be used when it's
m@2 9 ;; genuinely unclear what an operation means in the given
m@2 10 ;; context. In such cases, a condition handler might be the best
m@2 11 ;; approach anyway.
m@2 12 ((operation :initarg :operation
m@2 13 :reader undefined-action-operation)
m@2 14 (datatype :initarg :datatype
m@2 15 :reader undefined-action-datatype))
m@2 16 (:report (lambda (condition stream)
m@2 17 (format stream "The consequence of performing ~A on and object of type ~A is undefined"
m@2 18 (undefined-action-operation condition)
m@6 19 (undefined-action-datatype condition)))))
m@2 20
m@2 21 (define-condition insufficient-information (condition)
m@2 22 ;; It should be possible to construct genuinely minimal musical
m@2 23 ;; structures. When the information in these is insufficient to
m@2 24 ;; answer a query, this condition should be raised.
m@2 25 ((operation :initarg :operation
m@2 26 :reader insufficient-information-operation)
m@2 27 (datatype :initarg :datatype
m@2 28 :reader insufficient-information-datatype))
m@2 29 (:report (lambda (condition stream)
m@2 30 (format stream "The ~A object does not contain enough information to perform ~A"
m@2 31 (insufficient-information-datatype condition)
m@6 32 (insufficient-information-operation condition)))))
m@2 33
m@2 34