annotate base/conditions.lisp @ 27:a2cc2a093a27

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