]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences.extras: fix map-prior-from
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 17 Aug 2022 02:47:49 +0000 (21:47 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:03 +0000 (17:11 -0600)
extra/sequences/extras/extras-tests.factor
extra/sequences/extras/extras.factor

index b590f5cf429aed135a268a8bbea52efc69b023be..5d044a1781ceab3118ce2927c833c807aa1aaf77 100644 (file)
@@ -328,6 +328,14 @@ math prettyprint sequences sequences.extras strings tools.test ;
     V{ 5 16 42 103 } [ - ] map-prior
 ] unit-test
 
+{ V{ f f 26 61 } } [
+    2 V{ 5 16 42 103 } [ - ] map-prior-from
+] unit-test
+
+{ V{ f f 26 61 } } [
+    2 { 5 16 42 103 } [ - ] V{ } map-prior-from-as
+] unit-test
+
 { V{ } } [
     { } [ - ] V{ } map-prior-as
 ] unit-test
index 7b5563c01eda1f92214ed2788b48c63d53ef7489..d2bc9d624ef4c484584d85a878eda159e8d97135 100644 (file)
@@ -841,8 +841,8 @@ INSTANCE: step-slice virtual-sequence
 : map-prior-as ( ... seq quot: ( ... prior elt -- elt' ) exemplar -- seq' )
     0 -roll map-prior-from-as ; inline
 
-: map-prior-from ( ... seq quot: ( ... prior elt -- elt' ) i -- seq' )
-    pick map-prior-from-as ; inline
+: map-prior-from ( ... i seq quot: ( ... prior elt -- elt' ) -- seq' )
+    over map-prior-from-as ; inline
 
 : map-prior ( ... seq quot: ( ... prior elt -- elt' ) -- seq' )
     over map-prior-as ; inline