]> gitweb.factorcode.org Git - factor.git/commitdiff
clarify docs for case combinator
authorrazetime <raghuallthetime@hotmail.com>
Mon, 31 Oct 2022 10:50:16 +0000 (16:20 +0530)
committerrazetime <raghuallthetime@hotmail.com>
Mon, 31 Oct 2022 11:10:57 +0000 (16:40 +0530)
core/combinators/combinators-docs.factor

index 0f920a2555b775fbf1c8d81e75c88577eae45b49..46b8dc3b0dc94f3c7347ba13fe7fc535548246d8 100644 (file)
@@ -346,7 +346,9 @@ HELP: case
 { $description
     "Compares " { $snippet "obj" } " against the first element of every " { $link pair } ", evaluating the first element if it is a " { $link callable } ". If a pair matches, " { $snippet "obj" } " is removed from the stack and the second element of that pair (which must be a " { $link quotation } ") is " { $link call } "ed."
     $nl
-    "If there is no case matching " { $snippet "obj" } ", the default case is taken. If the last element of " { $snippet "assoc" } " is a quotation, the quotation is called with " { $snippet "obj" } " on the stack. Otherwise, a " { $link no-case } " error is raised."
+    "If the last element of the " { $snippet assoc } " is a quotation, that quotation is the default case. The default case is called with the " { $snippet "obj" } " on the stack, if there is no other case matching " { $snippet obj } "."
+    $nl
+    "If all the cases have failed and there is no default case to execute, a " { $link no-case } " error is raised."
     $nl
     "The following two phrases are equivalent:"
     { $code "{ { X [ Y ] } { Z [ T ] } } case" }