From f30230a2e4e6b3f747c2478d7ebf4da2ec86ea18 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 15 Nov 2009 15:28:18 -0600 Subject: [PATCH] add a >duration word --- basis/calendar/calendar.factor | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index ef22a98c80..90d087eda8 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -171,6 +171,10 @@ M: timestamp easter ( timestamp -- timestamp ) : microseconds ( x -- duration ) 1000000 / seconds ; : nanoseconds ( x -- duration ) 1000000000 / seconds ; +GENERIC: >duration ( obj -- duration ) +M: duration >duration ; +M: integer >duration seconds ; + GENERIC: year ( obj -- n ) M: integer year ; M: timestamp year year>> ;