changeset 121:4198b52e612b

More docstrings darcs-hash:20070727142154-f76cc-f59d4ad1216346f392d5b9f9e5b153a6f07a9bd9.gz
author David Lewis <d.lewis@gold.ac.uk>
date Fri, 27 Jul 2007 15:21:54 +0100
parents d2f68cedf573
children 997bed70ef28
files base/generics.lisp base/methods.lisp
diffstat 2 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/base/generics.lisp	Fri Jul 27 12:25:07 2007 +0100
+++ b/base/generics.lisp	Fri Jul 27 15:21:54 2007 +0100
@@ -102,7 +102,9 @@
 (defgeneric (setf timepoint) (value moment-designator))
 (defgeneric cut-off (anchored-period-designator) ; name?
   (:documentation "Returns a <moment> representing the point at
-  which the anchored period has ended.")
+  which the anchored period has ended. By default, is calculated
+  as the result of running time+ on the onset and period of the
+  object.")
   (:method (apd) (time+ (moment apd) (floating-period apd))))
 (defgeneric crotchet (object) 
   (:documentation "Returns a period, the duration of which represents
--- a/base/methods.lisp	Fri Jul 27 12:25:07 2007 +0100
+++ b/base/methods.lisp	Fri Jul 27 15:21:54 2007 +0100
@@ -174,41 +174,47 @@
 ;; Time protocol
 
 (defmethod time+ ((object1 moment) (object2 period))
-  "(time+ <moment> <period>) -> <moment> Implemented as a
-straightforward summation."
+  "Returns a <moment>. Implemented as a straightforward
+summation."
   (make-moment (+ (timepoint object1) (duration object2))))
 
 (defmethod time+ ((object1 period) (object2 moment)) ;?
-  "(time+ <period> <moment>) -> <moment> Implemented as a
-straightforward summation and defined by default as (time+
-<moment> <period>)."
+  "Returns a <moment>. Implemented as a straightforward summation
+and defined by default as (time+ <moment> <period>)."
   (time+ object2 object1))
 
 (defmethod time+ ((object1 period) (object2 period))
-  "(time+ <period> <period>) -> <period> Implemented as a
-straightforward summation."
+  "Returns a <period>. Implemented as a straightforward
+summation."
   (make-floating-period (+ (duration object1)
 			   (duration object2))))
 
 (defmethod time+ ((object1 moment) (object2 moment))
-  "(time+ <moment> <moment>) -> <condition:undefined-action> The
-question makes no sense."
+  "Returns <condition:undefined-action>. The question makes no
+sense."
   (error 'undefined-action :operation 'time+ :datatype (list (class-of object1) (class-of object2))))
 
 (defmethod time- ((object1 moment) (object2 moment))
+  "Returns <anchored-period> with an onset at object2 and
+  extending to object1"
   (make-anchored-period (timepoint object2)
 			(- (timepoint object1)
 			   (timepoint object2))))
 
 (defmethod time- ((object1 moment) (object2 period))
+  "Simple subtraction - Returns a <moment>"
   (make-moment (- (timepoint object1) (duration object2))))
 
 (defmethod time- ((object1 period) (object2 moment)) ;?
+  "Returns <condition:undefined-action>. The question makes no
+sense"
   (error 'undefined-action
 	 :operation 'time-
 	 :datatype (list (class-of object1) (class-of object2))))
 
 (defmethod time- ((object1 period) (object2 period))
+  "Returns <floating-period> spanning the difference of the
+periods"
   (make-floating-period (- (duration object2)
 			   (duration object1))))