view base/conditions.lisp @ 136:fd85f52d9f9d

Class revolution * PITCH-DESIGNATOR -> PITCH (PITCH removed) * MOMENT-DESIGNATOR -> MOMENT , MOMENT -> STANDARD-MOMENT * PERIOD-DESIGNATOR -> PERIOD , PERIOD -> STANDARD-PERIOD * ANCHORED-PERIOD-DESIGNATOR -> ANCHORED-PERIOD , ANCHORED-PERIOD -> STANDARD-ANCHORED-PERIOD * FLOATING-PERIOD removed * TIME-SIGNATURE-DESIGNATOR -> TIME-SIGNATURE & TIME-SIGNATURE-PERIOD * TIME-SIGNATURE -> STANDARD-TIME-SIGNATURE & STANDARD-TIME-SIGNATURE-PERIOD * KEY-SIGNATURE-DESIGNATOR -> KEY-SIGNATURE (& ...-PERIOD) * KEY-SIGNATURE -> STANDARD-KEY-SIGNATURE (& ...-PERIOD) * TEMPO now abstract (& TEMPO-PERIOD) * STANDARD-TEMPO AND STANDARD-TEMPO-PERIOD * COMPOSITION, CONSTITUENT & TIME-ORDERED-CONSTITUENT all have STANDARD- forms make-x methods and specialisers changes appropriately darcs-hash:20070831142943-f76cc-7be0d08963de06d87b36e4922076287d565c7ee2.gz
author David Lewis <d.lewis@gold.ac.uk>
date Fri, 31 Aug 2007 15:29:43 +0100
parents 8d2b1662f658
children b16472d7823f
line wrap: on
line source
(cl:in-package #:amuse) 

;; Some conditions we might want to be able to signal

(define-condition undefined-action (condition)
  ;; This condition would apply to an attempt to perform a meaningless
  ;; operation on an object. This may, initially, include things that
  ;; are a pain to implement but should really be used when it's
  ;; genuinely unclear what an operation means in the given
  ;; context. In such cases, a condition handler might be the best
  ;; approach anyway.
  ((operation :initarg :operation
	      :reader undefined-action-operation)
   (datatype :initarg :datatype
	     :reader undefined-action-datatype))
  (:report (lambda (condition stream)
	     (format stream "The consequence of performing ~A on and object of type ~A is undefined"
		     (undefined-action-operation condition)
		     (undefined-action-datatype condition)))))

(define-condition insufficient-information (condition)
  ;; It should be possible to construct genuinely minimal musical
  ;; structures. When the information in these is insufficient to
  ;; answer a query, this condition should be raised.
  ((operation :initarg :operation
	      :reader insufficient-information-operation)
   (datatype :initarg :datatype
	     :reader insufficient-information-datatype))
  (:report (lambda (condition stream)
	     (format stream "The ~A object does not contain enough information to perform ~A"
		     (insufficient-information-datatype condition)
		     (insufficient-information-operation condition)))))