]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.arrays/classes.struct: ensure specialized array types for struct array slots...
authorJoe Groff <arcata@gmail.com>
Mon, 22 Feb 2010 20:21:29 +0000 (12:21 -0800)
committerJoe Groff <arcata@gmail.com>
Mon, 22 Feb 2010 20:21:29 +0000 (12:21 -0800)
basis/alien/arrays/arrays.factor
basis/classes/struct/struct.factor

index 4fddba1de6ac068cdb0297e426e3d4de8867f8ee..f9a47f256c3f0d24fe0310bdfb27fdefca959f00 100644 (file)
@@ -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*
-    [ <c-direct-array> ] 2curry ;
+    unclip [ array-length ] dip [ <c-direct-array> ] 2curry ;
 
 M: array c-type-unboxer-quot drop [ >c-ptr ] ;
 
index af73be3aa4146269de3e6627c528499a06eec60c..3b2fc875c4321b45b9a76e34cc0fb8434cfdd9a1 100644 (file)
@@ -147,6 +147,7 @@ M: struct-class initial-value* <struct> ; 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