]> gitweb.factorcode.org Git - factor.git/commitdiff
binary-search: improve example for search.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 4 May 2017 01:23:05 +0000 (18:23 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 4 May 2017 01:23:05 +0000 (18:23 -0700)
(But use prettyprint, the help.lint.checks patch wasn't ready)

basis/binary-search/binary-search-docs.factor

index 314c0b8d5e98e20e121f06a8f918a88ff26eb1ad..8ab9f7fc95b0302630458327dc975bca124995b0 100644 (file)
@@ -12,15 +12,15 @@ $nl
 { $examples
     "Searching for an integer in a sorted array:"
     { $example
-        "USING: binary-search math.order prettyprint ;"
-        "{ -13 -4 1 9 16 17 28 } [ 5 >=< ] search . ."
-        "1\n2"
+        "USING: binary-search kernel math.order prettyprint ;"
+        "{ -130 -40 10 90 160 170 280 } [ 50 >=< ] search [ . ] bi@"
+        "2\n10"
     }
     "Frequently, the quotation passed to " { $link search } " is constructed by " { $link curry } " or " { $link with } " in order to make the search key a parameter:"
     { $example
         "USING: binary-search kernel math.order prettyprint ;"
-        "5 { -13 -4 1 9 16 17 28 } [ <=> ] with search . ."
-        "1\n2"
+        "50 { -130 -40 10 90 160 170 280 } [ <=> ] with search [ . ] bi@"
+        "2\n10"
     }
 } ;