m@24: (cl:in-package #:amuse) m@24: m@24: ;; Some conditions we might want to be able to signal m@24: m@24: (define-condition undefined-action (condition) m@24: ;; This condition would apply to an attempt to perform a meaningless m@24: ;; operation on an object. This may, initially, include things that m@24: ;; are a pain to implement but should really be used when it's m@24: ;; genuinely unclear what an operation means in the given m@24: ;; context. In such cases, a condition handler might be the best m@24: ;; approach anyway. m@24: ((operation :initarg :operation m@24: :reader undefined-action-operation) m@24: (datatype :initarg :datatype m@24: :reader undefined-action-datatype)) m@24: (:report (lambda (condition stream) m@24: (format stream "The consequence of performing ~A on and object of type ~A is undefined" m@24: (undefined-action-operation condition) m@24: (undefined-action-datatype condition))))) m@24: m@24: (define-condition insufficient-information (condition) m@24: ;; It should be possible to construct genuinely minimal musical m@24: ;; structures. When the information in these is insufficient to m@24: ;; answer a query, this condition should be raised. m@24: ((operation :initarg :operation m@24: :reader insufficient-information-operation) m@24: (datatype :initarg :datatype m@24: :reader insufficient-information-datatype)) m@24: (:report (lambda (condition stream) m@24: (format stream "The ~A object does not contain enough information to perform ~A" m@24: (insufficient-information-datatype condition) m@24: (insufficient-information-operation condition))))) m@24: m@24: