arrays: make it so pair? doesn't call length, fixes #1496

db4
Björn Lindqvist 2015-10-29 00:48:18 +01:00
parent 4b4a5d24e9
commit 1ee0823e52
2 changed files with 6 additions and 2 deletions

View 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

View 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= ;