diff base/methods.lisp @ 261:8e5f306b7e47

add 'onset-within' generics - does Allen say anything about this?
author Jamie Forth <j.forth@gold.ac.uk>
date Mon, 28 Mar 2011 21:40:37 +0100
parents f5836b2bf334
children 89c20fd8abc0
line wrap: on
line diff
--- a/base/methods.lisp	Sat Mar 19 18:51:23 2011 +0000
+++ b/base/methods.lisp	Mon Mar 28 21:40:37 2011 +0100
@@ -423,6 +423,18 @@
 		 (object2 anchored-period))
   (time= (cut-off object1) (cut-off object2)))
 
+;; Does Allen cover this? Anyway, they are useful for me -JF.
+(defmethod onset-within ((object1 moment)
+			 (object2 standard-anchored-period))
+  (and (time>= object1 object2)
+       (time<= object1 (cut-off object2))))
+
+(defmethod onset-within-fuzzy ((object1 moment)
+			       (object2 standard-anchored-period)
+			       (period standard-period))
+  (and (time>= object1 (time- (onset object2) period))
+       (time<= object1 (time- (cut-off object2) period))))
+
 ;; ...and
 
 (defmethod period= ((object1 anchored-period)