remove unused ntuck generalization, and rewrite napply not to use tuck
parent
6e9d369331
commit
9ec0c3e923
|
@ -332,12 +332,6 @@ HELP: nappend-as
|
|||
|
||||
{ nappend nappend-as } related-words
|
||||
|
||||
HELP: ntuck
|
||||
{ $values
|
||||
{ "n" integer }
|
||||
}
|
||||
{ $description "A generalization of " { $link tuck } " that can work for any stack depth. The top item will be copied and placed " { $snippet "n" } " items down on the stack." } ;
|
||||
|
||||
ARTICLE: "sequence-generalizations" "Generalized sequence operations"
|
||||
{ $subsections
|
||||
narray
|
||||
|
@ -357,7 +351,6 @@ ARTICLE: "shuffle-generalizations" "Generalized shuffle words"
|
|||
-nrot
|
||||
nnip
|
||||
ndrop
|
||||
ntuck
|
||||
mnswap
|
||||
nweave
|
||||
} ;
|
||||
|
|
|
@ -71,9 +71,6 @@ MACRO: ndrop ( n -- )
|
|||
MACRO: nnip ( n -- )
|
||||
'[ [ _ ndrop ] dip ] ;
|
||||
|
||||
MACRO: ntuck ( n -- )
|
||||
2 + '[ dup _ -nrot ] ;
|
||||
|
||||
MACRO: ndip ( n -- )
|
||||
[ [ dip ] curry ] n*quot [ call ] compose ;
|
||||
|
||||
|
@ -112,8 +109,8 @@ MACRO: cleave* ( n -- )
|
|||
[ 1 - [ [ [ keep ] curry ] dip compose ] n*quot [ call ] compose ]
|
||||
if-zero ;
|
||||
|
||||
MACRO: napply ( n -- )
|
||||
[ [ drop ] ] dip [ '[ tuck _ 2dip call ] ] times ;
|
||||
: napply ( quot n -- )
|
||||
[ dupn ] [ spread* ] bi ; inline
|
||||
|
||||
: apply-curry ( ...a quot n -- )
|
||||
[ [curry] ] dip napply ; inline
|
||||
|
|
Loading…
Reference in New Issue