annotate conditions.lisp @ 3:e854a73b0328

Add package definition and in-package forms. darcs-hash:20061025162304-aa3d6-85ddf506c4c08f698cd7057917770c0ce2ce4bf3.gz
author m.pearce <m.pearce@gold.ac.uk>
date Wed, 25 Oct 2006 17:23:04 +0100
parents 8fbbb0f14f3c
children cb470aecc3b0
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@2 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@2 32 (insufficient-information-operation condition)))
m@2 33
m@2 34