From be798dd5e9229e20e84535f46b0b58fb30f65b2a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 6 Nov 2008 00:01:50 -0600 Subject: [PATCH] We need to internalize tuple layouts in bootstrap, but since they're arrays we have to use a predicate class to detect them --- basis/bootstrap/image/image.factor | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index fdc8451173..80571d20b1 100644 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -378,6 +378,19 @@ M: array ' [ ' ] map array type-number object tag-number [ [ length emit-fixnum ] [ emit-seq ] bi ] emit-object ; +! This is a hack. We need to detect arrays which are tuple +! layout arrays so that they can be internalized, but making +! them a built-in type is not worth it. +PREDICATE: tuple-layout-array < array + dup length 5 >= [ + [ first tuple-class? ] + [ second fixnum? ] + [ third fixnum? ] + tri and and + ] [ drop f ] if ; + +M: tuple-layout-array ' [ call-next-method ] cache-object ; + ! Quotations M: quotation '