]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences.extras: add some words that might be useful
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 11 Feb 2023 07:42:06 +0000 (01:42 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:04 +0000 (17:11 -0600)
extra/sequences/extras/extras.factor

index 2ec7576c0e6a0beebc694461aad98623cb6002b4..0f71624c5babc2f71783217f37f28a8636f0f17b 100644 (file)
@@ -722,9 +722,15 @@ ERROR: slice-error-of from to seq ;
 : remove-nth-of ( seq n -- seq' )
     [ dup 1 + rot snip-slice ] keepd append-as ;
 
+: remove-nth-of* ( seq n -- nth seq' )
+    [ nth-of ] [ remove-nth-of ] 2bi ;
+
 : remove-nth-of! ( seq n -- seq )
     dup 1 + delete-slice-of ;
 
+: remove-nth-of*! ( seq n -- nth seq )
+    [ nth-of ] [ dup 1 + delete-slice-of ] 2bi ;
+
 : snip-of ( seq from to -- head tail )
     [ head ] [ tail ] bi-curry* bi ; inline