We need to internalize tuple layouts in bootstrap, but since they're arrays we have to use a predicate class to detect them

db4
Slava Pestov 2008-11-06 00:01:50 -06:00
parent cc879fa9b7
commit be798dd5e9
1 changed files with 13 additions and 0 deletions

View File

@ -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 '