diff --git a/basis/compiler/cfg/ssa/interference/interference.factor b/basis/compiler/cfg/ssa/interference/interference.factor index f8553ec9de..dd002ec977 100644 --- a/basis/compiler/cfg/ssa/interference/interference.factor +++ b/basis/compiler/cfg/ssa/interference/interference.factor @@ -58,7 +58,7 @@ PRIVATE> : sort-vregs-by-bb ( vregs -- alist ) defs get '[ dup _ at ] { } map>assoc - [ [ second pre-of ] compare ] sort ; + [ second pre-of ] sort-with ; : ?last ( seq -- elt/f ) [ f ] [ last ] if-empty ; inline diff --git a/basis/heaps/heaps-tests.factor b/basis/heaps/heaps-tests.factor index b476107562..c1985c516f 100644 --- a/basis/heaps/heaps-tests.factor +++ b/basis/heaps/heaps-tests.factor @@ -52,7 +52,7 @@ IN: heaps.tests ] each : sort-entries ( entries -- entries' ) - [ [ key>> ] compare ] sort ; + [ key>> ] sort-with ; : delete-test ( n -- obj1 obj2 ) [ diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index 84f708a687..6f87549619 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -115,7 +115,7 @@ TUPLE: result title href ; load-index swap >lower '[ [ drop _ ] dip >lower subseq? ] assoc-filter [ swap result boa ] { } assoc>map - [ [ title>> ] compare ] sort ; + [ title>> ] sort-with ; : article-apropos ( string -- results ) "articles.idx" offline-apropos ; diff --git a/basis/interval-maps/interval-maps.factor b/basis/interval-maps/interval-maps.factor index 22283deecb..b94266282c 100644 --- a/basis/interval-maps/interval-maps.factor +++ b/basis/interval-maps/interval-maps.factor @@ -46,7 +46,7 @@ PRIVATE> array>> [ value ] map ; : ( specification -- map ) - all-intervals [ [ first second ] compare ] sort + all-intervals [ first second ] sort-with >intervals ensure-disjoint interval-map boa ; : ( specification -- map ) diff --git a/basis/splitting/monotonic/monotonic.factor b/basis/splitting/monotonic/monotonic.factor index 088de52766..3dec6130de 100644 --- a/basis/splitting/monotonic/monotonic.factor +++ b/basis/splitting/monotonic/monotonic.factor @@ -64,6 +64,6 @@ TUPLE: upward-slice < slice ; drop [ downward-slices ] [ stable-slices ] - [ upward-slices ] tri 3append [ [ from>> ] compare ] sort + [ upward-slices ] tri 3append [ from>> ] sort-with ] } case ; diff --git a/basis/ui/gadgets/menus/menus.factor b/basis/ui/gadgets/menus/menus.factor index 159da59be5..70818262c5 100644 --- a/basis/ui/gadgets/menus/menus.factor +++ b/basis/ui/gadgets/menus/menus.factor @@ -65,7 +65,7 @@ M: ---- : ( target hook -- menu ) over object-operations [ primary-operation? ] partition - [ reverse ] [ [ [ command-name ] compare ] sort ] bi* + [ reverse ] [ [ command-name ] sort-with ] bi* { ---- } glue ; : show-operations-menu ( gadget target hook -- ) diff --git a/basis/ui/tools/inspector/inspector.factor b/basis/ui/tools/inspector/inspector.factor index 35fa5e3c17..b4a772dca5 100644 --- a/basis/ui/tools/inspector/inspector.factor +++ b/basis/ui/tools/inspector/inspector.factor @@ -57,7 +57,7 @@ M: object make-slot-descriptions make-mirror [ ] { } assoc>map ; M: hashtable make-slot-descriptions - call-next-method [ [ key-string>> ] compare ] sort ; + call-next-method [ key-string>> ] sort-with ; : ( model -- table ) [ make-slot-descriptions ] inspector-renderer diff --git a/basis/vocabs/prettyprint/prettyprint.factor b/basis/vocabs/prettyprint/prettyprint.factor index 0e150ef07a..66bc277ef7 100644 --- a/basis/vocabs/prettyprint/prettyprint.factor +++ b/basis/vocabs/prettyprint/prettyprint.factor @@ -14,7 +14,7 @@ IN: vocabs.prettyprint > ] compare ] sort >vector + [ name>> ] sort-with >vector [ dup empty? not ] [ dup largest-class [ over delete-nth ] dip ] produce nip ; diff --git a/core/sorting/sorting.factor b/core/sorting/sorting.factor index 312ddcd9be..b8258b239b 100644 --- a/core/sorting/sorting.factor +++ b/core/sorting/sorting.factor @@ -160,8 +160,8 @@ PRIVATE> : inv-sort-with ( seq quot -- sortedseq ) [ compare invert-comparison ] curry sort ; inline -: sort-keys ( seq -- sortedseq ) [ [ first ] compare ] sort ; +: sort-keys ( seq -- sortedseq ) [ first ] sort-with ; -: sort-values ( seq -- sortedseq ) [ [ second ] compare ] sort ; +: sort-values ( seq -- sortedseq ) [ second ] sort-with ; : sort-pair ( a b -- c d ) 2dup after? [ swap ] when ; diff --git a/core/source-files/errors/errors.factor b/core/source-files/errors/errors.factor index f6f4f4825a..86a8354071 100644 --- a/core/source-files/errors/errors.factor +++ b/core/source-files/errors/errors.factor @@ -7,7 +7,7 @@ IN: source-files.errors TUPLE: source-file-error error asset file line# ; : sort-errors ( errors -- alist ) - [ [ [ line#>> ] compare ] sort ] { } assoc-map-as sort-keys ; + [ [ line#>> ] sort-with ] { } assoc-map-as sort-keys ; : group-by-source-file ( errors -- assoc ) H{ } clone [ [ push-at ] curry [ dup file>> ] prepose each ] keep ; diff --git a/extra/dns/util/util.factor b/extra/dns/util/util.factor index f47eb7010c..6934d3bbd9 100644 --- a/extra/dns/util/util.factor +++ b/extra/dns/util/util.factor @@ -10,7 +10,7 @@ MACRO: 1if ( test then else -- ) '[ dup @ _ _ if ] ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -: sort-largest-first ( seq -- seq ) [ [ length ] compare ] sort reverse ; +: sort-largest-first ( seq -- seq ) [ length ] sort-with reverse ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index 6a52d02009..2c51d41aa0 100644 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -59,7 +59,7 @@ TUPLE: paste < entity annotations ; : pastes ( -- pastes ) f select-tuples - [ [ date>> ] compare ] sort + [ date>> ] sort-with reverse ; TUPLE: annotation < entity parent ; diff --git a/extra/webapps/planet/planet.factor b/extra/webapps/planet/planet.factor index 12b7ccda24..8ada4be638 100755 --- a/extra/webapps/planet/planet.factor +++ b/extra/webapps/planet/planet.factor @@ -56,7 +56,7 @@ posting "POSTINGS" : blogroll ( -- seq ) f select-tuples - [ [ name>> ] compare ] sort ; + [ name>> ] sort-with ; : postings ( -- seq ) posting new select-tuples diff --git a/extra/webapps/wiki/wiki.factor b/extra/webapps/wiki/wiki.factor index 5689f23d4e..118f92061b 100644 --- a/extra/webapps/wiki/wiki.factor +++ b/extra/webapps/wiki/wiki.factor @@ -307,7 +307,7 @@ M: revision feed-entry-url id>> revision-url ; [ f
select-tuples - [ [ title>> ] compare ] sort + [ title>> ] sort-with "articles" set-value ] >>init