]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/sorting/bubble/bubble.factor
Rename and add sorting words
[factor.git] / extra / sorting / bubble / bubble.factor
index 74115774c8b22692e19646ff31782f0105f97dbc..adb5c0a1646d4c300805b31049ea139a67aedc99 100644 (file)
@@ -8,7 +8,7 @@ IN: sorting.bubble
 
 <PRIVATE
 
-:: (bubble-sort!) ( seq quot: ( obj1 obj2 -- <=> ) -- )
+:: (bubble-sort-with!) ( seq quot: ( obj1 obj2 -- <=> ) -- )
     seq length 1 - [
         f over [0..b) [| i |
             i i 1 + [ seq nth-unsafe ] bi@ 2dup quot call +gt+ =
@@ -19,8 +19,7 @@ IN: sorting.bubble
 
 PRIVATE>
 
-: bubble-sort! ( seq quot: ( obj1 obj2 -- <=> ) -- )
-    over length 2 < [ 2drop ] [ (bubble-sort!) ] if ; inline
+: bubble-sort-with! ( seq quot: ( obj1 obj2 -- <=> ) -- )
+    over length 2 < [ 2drop ] [ (bubble-sort-with!) ] if ; inline
 
-: natural-bubble-sort! ( seq -- )
-    [ <=> ] bubble-sort! ;
+: bubble-sort! ( seq -- ) [ <=> ] bubble-sort-with! ;