]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/alien/data/map/map.factor
factor: trim using lists
[factor.git] / extra / alien / data / map / map.factor
index 1abb3a76ef3f7e6e4f9812af3a7a08c26ec7e367..a7a50f57622b08ed957b69bf25d2a4106449f3e0 100644 (file)
@@ -1,7 +1,8 @@
-! (c)Joe Groff bsd license
-USING: accessors alien alien.c-types alien.data alien.parser arrays
-byte-arrays combinators effects.parser fry generalizations grouping kernel
-lexer locals macros make math math.ranges parser sequences
+! Copyright (C) 2009, 2010 Joe Groff.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors alien alien.arrays alien.c-types alien.data
+alien.parser arrays byte-arrays combinators effects.parser fry
+generalizations grouping kernel make math sequences
 sequences.generalizations sequences.private ;
 FROM: alien.arrays => array-length ;
 IN: alien.data.map
@@ -84,7 +85,8 @@ MACRO: unpack-params ( ins -- quot )
     [ c-type-count nip '[ _ firstn-unsafe ] ] map '[ _ spread ] ;
 
 MACRO: pack-params ( outs -- quot )
-    [ ] [ c-type-count nip dup [ [ ndip _ ] dip set-firstn ] 3curry ] reduce
+    [ ] [ c-type-count nip dup
+    [ [ ndip POSTPONE: _ ] dip set-firstn ] 3curry ] reduce
     fry [ call ] compose ;
 
 :: [data-map] ( ins outs param-quot -- quot )