minor fixes in sorting
parent
567bd334a0
commit
c1d1fe9b20
|
|
@ -18,7 +18,7 @@ HELP: sort-by-slots
|
||||||
}
|
}
|
||||||
{ $description "Sorts a sequence of tuples by the sort-specs in " { $snippet "sort-spec" } ". A sort-spec is a sequence of slot accessors ending in a comparator." }
|
{ $description "Sorts a sequence of tuples by the sort-specs in " { $snippet "sort-spec" } ". A sort-spec is a sequence of slot accessors ending in a comparator." }
|
||||||
{ $examples
|
{ $examples
|
||||||
"Sort by slot c, then b descending:"
|
"Sort by slot a, then b descending:"
|
||||||
{ $example
|
{ $example
|
||||||
"USING: accessors math.order prettyprint sorting.slots ;"
|
"USING: accessors math.order prettyprint sorting.slots ;"
|
||||||
"IN: scratchpad"
|
"IN: scratchpad"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ IN: sorting.slots
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: short-circuit-comparator ( obj1 obj2 word -- comparator/? )
|
: short-circuit-comparator ( obj1 obj2 word -- comparator/? )
|
||||||
execute( obj1 obj2 -- obj3 )
|
execute( obj1 obj2 -- obj3 )
|
||||||
dup +eq+ eq? [ drop f ] when ;
|
dup +eq+ eq? [ drop f ] when ;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue