]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/sorting/extras/extras.factor
Rename and add sorting words
[factor.git] / extra / sorting / extras / extras.factor
index ae90b05109da4d47d3fc810c180a5b7974396135..7adb7191712511d8c34ec0efaee5c2b81a3cb249 100644 (file)
@@ -5,11 +5,11 @@ IN: sorting.extras
 : argsort ( seq quot: ( obj1 obj2 -- <=> ) -- sortedseq )
     [ zip-index ] dip
     [ [ first-unsafe ] bi@ ] prepose
-    sort [ second-unsafe ] map! ; inline
+    sort-with [ second-unsafe ] map! ; inline
 
 : map-sort ( ... seq quot: ( ... elt -- ... key ) -- ... sortedseq )
     [ keep ] curry { } map>assoc
-    [ { array } declare first-unsafe ] sort-with
+    [ { array } declare first-unsafe ] sort-by
     [ { array } declare second-unsafe ] map ; inline
 
 :: bisect-left ( obj seq -- i )