Mercurial > hg > amuse
comparison base/methods.lisp @ 137:ee9dd7148eab
Bug fixes from class changes
darcs-hash:20070903105727-f76cc-34a2defdf8503bb63c452d3c29c72ae2a42d4753.gz
author | David Lewis <d.lewis@gold.ac.uk> |
---|---|
date | Mon, 03 Sep 2007 11:57:27 +0100 |
parents | fd85f52d9f9d |
children | b753a56c373b |
comparison
equal
deleted
inserted
replaced
136:fd85f52d9f9d | 137:ee9dd7148eab |
---|---|
181 (make-standard-moment (+ (timepoint moment) (duration period)))) | 181 (make-standard-moment (+ (timepoint moment) (duration period)))) |
182 | 182 |
183 (defmethod time+ ((period standard-period) (moment standard-moment)) ;? | 183 (defmethod time+ ((period standard-period) (moment standard-moment)) ;? |
184 "Returns a <standard-moment>. Implemented as a straightforward | 184 "Returns a <standard-moment>. Implemented as a straightforward |
185 summation and defined by default as (time+ <moment> <period>)." | 185 summation and defined by default as (time+ <moment> <period>)." |
186 (time+ standard-moment period)) | 186 (time+ moment period)) |
187 | 187 |
188 (defmethod time+ ((period1 standard-period) | 188 (defmethod time+ ((period1 standard-period) |
189 (period2 standard-period)) | 189 (period2 standard-period)) |
190 "Returns a <standard-period>. Implemented as a straightforward | 190 "Returns a <standard-period>. Implemented as a straightforward |
191 summation." | 191 summation." |
194 | 194 |
195 (defmethod time+ ((moment1 moment) (moment2 moment)) | 195 (defmethod time+ ((moment1 moment) (moment2 moment)) |
196 "Returns <condition:undefined-action>. The question makes no | 196 "Returns <condition:undefined-action>. The question makes no |
197 sense." | 197 sense." |
198 (error 'undefined-action :operation 'time+ | 198 (error 'undefined-action :operation 'time+ |
199 :datatype (list (class-of object1) (class-of object2)))) | 199 :datatype (list (class-of moment1) (class-of moment2)))) |
200 | 200 |
201 (defmethod time- ((moment1 standard-moment) (moment2 standard-moment)) | 201 (defmethod time- ((moment1 standard-moment) (moment2 standard-moment)) |
202 "Returns <standard-anchored-period> with an onset at moment2 and | 202 "Returns <standard-anchored-period> with an onset at moment2 and |
203 extending to moment1" | 203 extending to moment1" |
204 (make-standard-anchored-period (timepoint moment2) | 204 (make-standard-anchored-period (timepoint moment2) |
213 (defmethod time- ((period period) (moment moment)) ;? | 213 (defmethod time- ((period period) (moment moment)) ;? |
214 "Returns <condition:undefined-action>. The question makes no | 214 "Returns <condition:undefined-action>. The question makes no |
215 sense" | 215 sense" |
216 (error 'undefined-action | 216 (error 'undefined-action |
217 :operation 'time- | 217 :operation 'time- |
218 :datatype (list (class-of object1) (class-of object2)))) | 218 :datatype (list (class-of period) (class-of moment)))) |
219 | 219 |
220 (defmethod time- ((period1 standard-period) (period2 standard-period)) | 220 (defmethod time- ((period1 standard-period) (period2 standard-period)) |
221 "Returns <standard-period> spanning the difference of the | 221 "Returns <standard-period> spanning the difference of the |
222 periods" | 222 periods" |
223 (make-standard-period (- (duration period2) | 223 (make-standard-period (- (duration period2) |
251 | 251 |
252 (defmethod duration= ((period1 standard-period) (period2 standard-period)) | 252 (defmethod duration= ((period1 standard-period) (period2 standard-period)) |
253 (= (duration period1) (duration period2))) | 253 (= (duration period1) (duration period2))) |
254 | 254 |
255 (defmethod duration* ((period1 standard-period) (object2 number)) | 255 (defmethod duration* ((period1 standard-period) (object2 number)) |
256 (make-floating-period (* (duration period1) object2))) | 256 (make-standard-period (* (duration period1) object2))) |
257 | 257 |
258 (defmethod duration* ((object1 number) (period standard-period)) | 258 (defmethod duration* ((object1 number) (period standard-period)) |
259 (duration* period object1)) | 259 (duration* period object1)) |
260 | 260 |
261 (defmethod duration/ ((period standard-period) (object2 number)) | 261 (defmethod duration/ ((period standard-period) (object2 number)) |
262 (make-floating-period (/ (duration period) object2))) | 262 (make-standard-period (/ (duration period) object2))) |
263 | 263 |
264 ;;;; Pitch protocol | 264 ;;;; Pitch protocol |
265 | 265 |
266 ;;; Some catch-all methods for undefined operations and cases where we | 266 ;;; Some catch-all methods for undefined operations and cases where we |
267 ;;; don't have enough information: | 267 ;;; don't have enough information: |