add a >duration word

db4
Doug Coleman 2009-11-15 15:28:18 -06:00
parent fe6deb6b75
commit f30230a2e4
1 changed files with 4 additions and 0 deletions

View File

@ -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>> ;