]> gitweb.factorcode.org Git - factor.git/commitdiff
core-foundation.time: change epoch to constant.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 23 May 2014 20:26:49 +0000 (13:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 23 May 2014 20:26:49 +0000 (13:26 -0700)
basis/core-foundation/time/time.factor

index 37c4ff5d0e5e78e303431a10cd8423d92365d1dd..9d22e4752d7ac0a0b89b3d68a370b6bb0d589d7f 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: calendar math alien.c-types alien.syntax memoize system ;
+USING: alien.c-types alien.syntax calendar literals math ;
 IN: core-foundation.time
 
 TYPEDEF: double CFTimeInterval
@@ -8,8 +8,10 @@ TYPEDEF: double CFAbsoluteTime
 
 ALIAS: >CFTimeInterval duration>seconds
 
-MEMO: epoch ( -- micros )
-    T{ timestamp { year 2001 } { month 1 } { day 1 } } timestamp>micros ;
+CONSTANT: epoch $[
+    T{ timestamp { year 2001 } { month 1 } { day 1 } }
+    timestamp>micros
+]
 
 : >CFAbsoluteTime ( micros -- time )
     epoch - 1,000,000 /f ; inline