annotate base/conditions.lisp @ 193:c18f795f4463

rollback the amuse.asd generics/classes dependency fix Ignore-this: be4e0351d31f24f5348cc8dc434477dc Fix properly this time by moving the specialized get-constituents method from generics to methods. rolling back: Wed Jan 23 15:55:34 GMT 2008 Jamie Forth <j.forth@gold.ac.uk> * Fixed amuse.asd dependency - generics depends on classes. M ./amuse.asd -2 +2 darcs-hash:20090524164116-16a00-2b561eab1a5829a251eb5e9b40357945af13e6a6.gz
author j.forth <j.forth@gold.ac.uk>
date Sun, 24 May 2009 17:41:16 +0100
parents b16472d7823f
children 376357c84189
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@172 17 (format stream "The consequence of performing ~A on an 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@172 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