]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/benchmark/fib4/fib4.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / extra / benchmark / fib4 / fib4.factor
index 580be0d0ecfffb3706e9480ba06164c060e2fd7b..fa49503797be993608ee5981de72145f4dde6009 100644 (file)
@@ -1,7 +1,7 @@
 USING: accessors math kernel debugger ;
 IN: benchmark.fib4
 
-TUPLE: box i ;
+TUPLE: box { i read-only } ;
 
 C: <box> box
 
@@ -9,14 +9,14 @@ C: <box> box
     dup i>> 1 <= [
         drop 1 <box>
     ] [
-        i>> 1- <box>
+        i>> 1 - <box>
         dup tuple-fib
         swap
-        i>> 1- <box>
+        i>> 1 - <box>
         tuple-fib
         swap i>> swap i>> + <box>
-    ] if ;
+    ] if ; inline recursive
 
-: fib-main ( -- ) T{ box f 34 } tuple-fib T{ box f 9227465 } assert= ;
+: fib-main ( -- ) T{ box f 34 } tuple-fib i>> 9227465 assert= ;
 
 MAIN: fib-main