]> gitweb.factorcode.org Git - factor.git/commitdiff
combinators: moving M\ iota hashcode* back since each-integer has hints.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 5 Mar 2013 01:46:46 +0000 (17:46 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 5 Mar 2013 01:46:46 +0000 (17:46 -0800)
core/combinators/combinators.factor
core/layouts/layouts.factor

index 1a76bcc70ece7b34d8640394942bb7bd9cc3d279..b6e87f45eb31a29839bd81c29fa33606b5290b51 100644 (file)
@@ -201,6 +201,11 @@ M: reversed hashcode* [ sequence-hashcode ] recursive-hashcode ;
 
 M: slice hashcode* [ sequence-hashcode ] recursive-hashcode ;
 
+M: iota hashcode*
+    over 0 <= [ 2drop 0 ] [
+        nip length 0 swap [ sequence-hashcode-step ] each-integer
+    ] if ;
+
 M: hashtable hashcode*
     [
         dup assoc-size 1 eq?
index a7bfbb7c2ddc396237d1f69a401f1cdad4a25fd9..e6e238eefd28eb9c01317fc87e2c8ac9a1593325 100644 (file)
@@ -91,17 +91,4 @@ M: real >integer
     dup most-negative-fixnum most-positive-fixnum between?
     [ >fixnum ] [ >bignum ] if ; inline
 
-! we put this here so that it can use the references to
-! most-positive-fixnum otherwise would be in combinatrs
-M: iota hashcode*
-    over 0 <= [ 2drop 0 ] [
-        nip length [
-            0 most-positive-fixnum clamp integer>fixnum
-            0 swap [ sequence-hashcode-step ] each-integer
-        ] [
-            most-positive-fixnum swap
-            [ sequence-hashcode-step ] (each-integer)
-        ] bi
-    ] if ;
-
 UNION: immediate fixnum POSTPONE: f ;