From 1bf37f01e57d531fe37076a6a666933535dc8468 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 22 Feb 2010 12:21:29 -0800 Subject: [PATCH] alien.arrays/classes.struct: ensure specialized array types for struct array slots get instantiated at parse time --- basis/alien/arrays/arrays.factor | 5 +---- basis/classes/struct/struct.factor | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/basis/alien/arrays/arrays.factor b/basis/alien/arrays/arrays.factor index 4fddba1de6..f9a47f256c 100644 --- a/basis/alien/arrays/arrays.factor +++ b/basis/alien/arrays/arrays.factor @@ -35,10 +35,7 @@ M: array box-return drop void* box-return ; M: array stack-size drop void* stack-size ; M: array c-type-boxer-quot - unclip - [ array-length ] - [ [ require-c-array ] keep ] bi* - [ ] 2curry ; + unclip [ array-length ] dip [ ] 2curry ; M: array c-type-unboxer-quot drop [ >c-ptr ] ; diff --git a/basis/classes/struct/struct.factor b/basis/classes/struct/struct.factor index af73be3aa4..3b2fc875c4 100644 --- a/basis/classes/struct/struct.factor +++ b/basis/classes/struct/struct.factor @@ -147,6 +147,7 @@ M: struct-class initial-value* ; inline GENERIC: struct-slot-values ( struct -- sequence ) M: struct-class reader-quot + dup array? [ dup first define-array-vocab drop ] when nip '[ _ read-struct-slot ] ; M: struct-class writer-quot