models.arrow.multi corrections- uses macro

db4
Sam Anklesaria 2009-05-05 20:44:05 -05:00
parent fc01d07839
commit bdff947b1f
1 changed files with 6 additions and 6 deletions

View File

@ -1,11 +1,11 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: models.arrow models.product stack-checker accessors fry
generalizations kernel ;
USING: macros models.arrow models.product fry
generalizations kernel sequences ;
IN: models.arrow.multi
: <n-arrow> ( quot int -- arrow )
[ narray <product> ] [ '[ _ firstn @ ] <arrow> ] bi ; inline
MACRO: <n-arrow> ( int -- quot ) dup
'[ [ _ narray <product> ] dip [ _ firstn ] prepend <arrow> ] ;
: <2arrow> ( a b quot -- arrow ) 2 <n-arrow> ;
: <3arrow> ( a b c quot -- arrow ) 3 <n-arrow> ;
: <2arrow> ( a b quot -- arrow ) 2 <n-arrow> ; inline
: <3arrow> ( a b c quot -- arrow ) 3 <n-arrow> ; inline