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