remove a couple usings and nrev
parent
7644d51e3b
commit
e9f2197590
|
@ -139,15 +139,6 @@ HELP: -nrot
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
HELP: nrev
|
|
||||||
{ $values { "n" integer } }
|
|
||||||
{ $description "A generalization of " { $link spin } " that reverses any number of items at the top of the stack."
|
|
||||||
}
|
|
||||||
{ $examples
|
|
||||||
{ $example "USING: prettyprint generalizations ;" "1 2 3 4 4 nrev .s" "4\n3\n2\n1" }
|
|
||||||
"The " { $link spin } " word is equivalent to " { $snippet "3 nrev" } "."
|
|
||||||
} ;
|
|
||||||
|
|
||||||
HELP: ndip
|
HELP: ndip
|
||||||
{ $values { "quot" quotation } { "n" integer } }
|
{ $values { "quot" quotation } { "n" integer } }
|
||||||
{ $description "A generalization of " { $link dip } " that can work "
|
{ $description "A generalization of " { $link dip } " that can work "
|
||||||
|
@ -327,7 +318,6 @@ $nl
|
||||||
{ $subsection nnip }
|
{ $subsection nnip }
|
||||||
{ $subsection ndrop }
|
{ $subsection ndrop }
|
||||||
{ $subsection ntuck }
|
{ $subsection ntuck }
|
||||||
{ $subsection nrev }
|
|
||||||
{ $subsection mnswap }
|
{ $subsection mnswap }
|
||||||
"Generalized combinators:"
|
"Generalized combinators:"
|
||||||
{ $subsection ndip }
|
{ $subsection ndip }
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2007, 2008 Chris Double, Doug Coleman, Eduardo
|
! Copyright (C) 2007, 2008 Chris Double, Doug Coleman, Eduardo
|
||||||
! Cavazos, Slava Pestov.
|
! Cavazos, Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel sequences sequences.private math math.ranges
|
USING: kernel sequences sequences.private math combinators
|
||||||
combinators macros quotations fry macros locals ;
|
macros quotations fry ;
|
||||||
IN: generalizations
|
IN: generalizations
|
||||||
|
|
||||||
<<
|
<<
|
||||||
|
@ -51,9 +51,6 @@ MACRO: nnip ( n -- )
|
||||||
MACRO: ntuck ( n -- )
|
MACRO: ntuck ( n -- )
|
||||||
2 + '[ dup _ -nrot ] ;
|
2 + '[ dup _ -nrot ] ;
|
||||||
|
|
||||||
MACRO: nrev ( n -- )
|
|
||||||
1 [a,b] [ ] [ '[ @ _ -nrot ] ] reduce ;
|
|
||||||
|
|
||||||
MACRO: ndip ( quot n -- )
|
MACRO: ndip ( quot n -- )
|
||||||
[ '[ _ dip ] ] times ;
|
[ '[ _ dip ] ] times ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue