1 USING: kernel sequences functors fry macros generalizations ;
2 IN: models.combinators.templates
3 FROM: models.combinators => <collection> #1 ;
4 FUNCTOR: fmaps ( W -- )
15 MACRO: w-n ( int -- quot ) dup '[ [ _ narray <collection> ] dip [ _ firstn ] prepend W ] ;
16 : w-2 ( a b quot -- mapped ) 2 w-n ; inline
17 : w-3 ( a b c quot -- mapped ) 3 w-n ; inline
18 : w-4 ( a b c d quot -- mapped ) 4 w-n ; inline
19 MACRO: w-n* ( int -- quot ) dup '[ [ _ narray <collection> #1 ] dip [ _ firstn ] prepend W ] ;
20 : w-2* ( a b quot -- mapped ) 2 w-n* ; inline
21 : w-3* ( a b c quot -- mapped ) 3 w-n* ; inline
22 : w-4* ( a b c d quot -- mapped ) 4 w-n* ; inline