From 1ee0823e52889ec2d3005d95ff744d89b6f0ea97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Lindqvist?= Date: Thu, 29 Oct 2015 00:48:18 +0100 Subject: [PATCH] arrays: make it so pair? doesn't call length, fixes #1496 --- core/arrays/arrays-tests.factor | 4 ++++ core/arrays/arrays.factor | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/arrays/arrays-tests.factor b/core/arrays/arrays-tests.factor index e0d171a398..aa162751af 100644 --- a/core/arrays/arrays-tests.factor +++ b/core/arrays/arrays-tests.factor @@ -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 diff --git a/core/arrays/arrays.factor b/core/arrays/arrays.factor index 8fc2f88b65..cd4c207afa 100644 --- a/core/arrays/arrays.factor +++ b/core/arrays/arrays.factor @@ -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= ; -- 2.34.1