]> gitweb.factorcode.org Git - factor.git/commitdiff
working on sorting.slots
authorDoug Coleman <erg@jobim.local>
Sat, 18 Apr 2009 06:38:39 +0000 (01:38 -0500)
committerDoug Coleman <erg@jobim.local>
Sat, 18 Apr 2009 06:38:39 +0000 (01:38 -0500)
basis/sorting/slots/slots.factor

index 9a0455c3a73147533c4c26ad0d8171b17460af21..5b910cb621bf9d47566cebeb5cfbe7e91ff99806 100644 (file)
@@ -9,7 +9,7 @@ IN: sorting.slots
 
 : short-circuit-comparator ( obj1 obj2 word --  comparator/? )
     execute( obj1 obj2 -- obj3 )
-    dup +eq+ eq? [ drop f ] when ; inline
+    dup +eq+ eq? [ drop f ] when ;
 
 : slot-comparator ( seq -- quot )
     [
@@ -17,12 +17,12 @@ IN: sorting.slots
         [ '[ [ _ execute( tuple -- value ) ] bi@ ] ] map concat
     ] [
         peek
-        '[ @ _ short-circuit-comparator ]
+        '[ _ call( obj1 obj2 -- obj3 obj4 ) _ short-circuit-comparator ]
     ] bi ;
 
 PRIVATE>
 
-MACRO: compare-slots ( sort-specs -- <=> )
+MACRO: compare-slots ( sort-specs -- quot )
     #! sort-spec: { accessors comparator }
     [ slot-comparator ] map '[ _ 2|| +eq+ or ] ;