 ! Copyright (C) 2007, 2008 Chris Double, Doug Coleman, Eduardo
 ! Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences sequences.private namespaces math math.ranges
-combinators macros quotations fry locals arrays ;
+USING: kernel sequences sequences.private namespaces math
+math.ranges combinators macros quotations fry arrays ;
 IN: generalizations
 
 MACRO: narray ( n -- quot )

    [ ] [ 1+ ] [ ] tri
    '[ [ , ndup ] dip , -nrot , nslip ] ;

MACRO: ncurry ( n -- ) [ curry ] n*quot ;

MACRO:: nwith ( quot n -- )
    [let | n' [ n 1+ ] |
        [ n' -nrot [ n' nrot quot call ] n ncurry ] ] ;

MACRO: napply ( n -- )
    2 [a,b]

    2 + [ dupd -nrot ] curry ;

MACRO: nrev ( n -- quot )
    1 [a,b] [ ] [ '[ @ , -nrot ] ] reduce ;

MACRO: ndip ( quot n -- )
    dup saver -rot restorer 3append ;
