comparison base/methods.lisp @ 100:ad9cca28fecf

Added doc-strings darcs-hash:20070725171218-f76cc-c62173b38861d7c368d5219cc743d85a4f67fda8.gz
author David Lewis <d.lewis@gold.ac.uk>
date Wed, 25 Jul 2007 18:12:18 +0100
parents 0b4c624910f1
children 67f96832cfb0
comparison
equal deleted inserted replaced
99:43d3e707b384 100:ad9cca28fecf
198 198
199 199
200 ;; Time protocol 200 ;; Time protocol
201 201
202 (defmethod time+ ((object1 moment) (object2 period)) 202 (defmethod time+ ((object1 moment) (object2 period))
203 "(time+ <moment> <period>) -> <moment> Implemented as a
204 straightforward summation."
203 (make-moment (+ (timepoint object1) (duration object2)))) 205 (make-moment (+ (timepoint object1) (duration object2))))
204 206
205 (defmethod time+ ((object1 period) (object2 moment)) ;? 207 (defmethod time+ ((object1 period) (object2 moment)) ;?
208 "(time+ <period> <moment>) -> <moment> Implemented as a
209 straightforward summation."
206 (time+ object2 object1)) 210 (time+ object2 object1))
207 211
208 (defmethod time+ ((object1 period) (object2 period)) 212 (defmethod time+ ((object1 period) (object2 period))
213 "(time+ <period> <period>) -> <period> Implemented as a
214 straightforward summation."
209 (make-floating-period (+ (duration object1) 215 (make-floating-period (+ (duration object1)
210 (duration object2)))) 216 (duration object2))))
211 217
212 (defmethod time+ ((object1 moment) (object2 moment)) 218 (defmethod time+ ((object1 moment) (object2 moment))
219 "(time+ <moment> <moment>) -> <condition:undefined-action> The
220 question makes no sense."
213 (error 'undefined-action :operation 'time+ :datatype (list (class-of object1) (class-of object2)))) 221 (error 'undefined-action :operation 'time+ :datatype (list (class-of object1) (class-of object2))))
214 222
215 (defmethod time- ((object1 moment) (object2 moment)) 223 (defmethod time- ((object1 moment) (object2 moment))
216 (make-anchored-period (timepoint object2) 224 (make-anchored-period (timepoint object2)
217 (- (timepoint object1) 225 (- (timepoint object1)