]> gitweb.factorcode.org Git - factor.git/commitdiff
arrays: make it so pair? doesn't call length, fixes #1496
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 28 Oct 2015 23:48:18 +0000 (00:48 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 28 Oct 2015 23:48:18 +0000 (00:48 +0100)
core/arrays/arrays-tests.factor
core/arrays/arrays.factor

index e0d171a3989d3af8ee648926b11ffe402df6490a..aa162751aff2759db1a94fbf99d5ba8b3ff95d9f 100644 (file)
@@ -25,3 +25,7 @@ IN: arrays.tests
     ${ "kernel-error" ERROR-OUT-OF-FIXNUM-RANGE 147573952589676412928 f }
     =
 ] must-fail-with
+
+{ t } [
+    1 2 2array pair?
+] unit-test
index 8fc2f88b6526a6e9fb0847ea2fe22c18adc34722..cd4c207afa01a0a0b2c1da9a1d7b21ea9992a6cf 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2005, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel math sequences sequences.private ;
+USING: accessors kernel math sequences sequences.private slots.private ;
 IN: arrays
 
 BUILTIN: array { length array-capacity read-only initial: 0 } ;
@@ -25,4 +25,4 @@ INSTANCE: array sequence
 : 3array ( x y z -- array ) { } 3sequence ; inline
 : 4array ( w x y z -- array ) { } 4sequence ; inline
 
-PREDICATE: pair < array length 2 number= ;
+PREDICATE: pair < array 1 slot 2 number= ;