     [ slots{ year month } ] same? ;
 
 :: (day-of-year) ( year month day -- n )
-    month days-until nth day + {
+    month cumulative-day-counts nth day + {
         [ year leap-year? ]
         [ month 3 >= ]
     } 0&& [ 1 + ] when ;


: hence ( duration -- timestamp ) now swap time+ ;
: ago ( duration -- timestamp ) now swap time- ;

GENERIC: days-in-year ( obj -- n )


<<
CONSTANT: day-counts { 0 31 28 31 30 31 30 31 31 30 31 30 31 }
>>
CONSTANT: cumulative-day-counts $[ day-counts cum-sum0 ]

PRIVATE>

