Remove switch from sequences-lib (exists as exchange).

db4
John Benediktsson 2008-10-01 17:46:09 -07:00
parent cdf7091ae8
commit 0b57ce6c52
2 changed files with 0 additions and 16 deletions

View File

@ -27,14 +27,3 @@ HELP: enumerate
{ $values { "seq" sequence } { "seq'" sequence } }
{ $description "Returns a new sequence where each element is an array of { index, value }" } ;
HELP: switch
{ $values { "x" number } { "y" number } { "seq" sequence } }
{ $description "Swaps the values between indices 'x' and 'y' in the sequence." }
{ $examples
{ $example
"USING: sequences.lib ;"
"1 2 \"asdf\" [ switch ] keep"
"\"adsf\"" }
} ;

View File

@ -173,8 +173,3 @@ USE: random
: enumerate ( seq -- seq' )
<enum> >alist ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: switch ( x y seq -- )
3dup swap [ nth ] dip [ [ move ] keep ] 2dip rot set-nth ;