]> gitweb.factorcode.org Git - factor.git/commitdiff
syntax-docs: improve descriptions for GENERIC: and GENERIC#:
authorAlexander Iljin <ajsoft@yandex.ru>
Tue, 17 Oct 2017 20:58:35 +0000 (23:58 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 22 Jan 2018 15:58:17 +0000 (07:58 -0800)
core/syntax/syntax-docs.factor

index 30e18607946f1cacd87a2020fa3d00e8639b7a1f..3fa9481623e9b87fee59c1f4269d8c28dbbb72ec 100644 (file)
@@ -671,16 +671,16 @@ HELP: NAN:
 HELP: GENERIC:
 { $syntax "GENERIC: word ( stack -- effect )" }
 { $values { "word" "a new word to define" } }
-{ $description "Defines a new generic word in the current vocabulary. Initially, it contains no methods, and thus will throw a " { $link no-method } " error when called." } ;
+{ $description "Defines a new generic word in the current vocabulary. The word dispatches on the topmost stack element. Initially it contains no methods, and thus will throw a " { $link no-method } " error when called." } ;
 
 HELP: GENERIC#:
 { $syntax "GENERIC#: word n ( stack -- effect )" }
 { $values { "word" "a new word to define" } { "n" "the stack position to dispatch on" } }
-{ $description "Defines a new generic word which dispatches on the " { $snippet "n" } "th most element from the top of the stack in the current vocabulary. Initially, it contains no methods, and thus will throw a " { $link no-method } " error when called." }
+{ $description "Defines a new generic word in the current vocabulary. The word dispatches on the " { $snippet "n" } "th element from the top of the stack. Initially it contains no methods, and thus will throw a " { $link no-method } " error when called." }
 { $notes
     "The following two definitions are equivalent:"
-    { $code "GENERIC: foo ( obj -- )" }
-    { $code "GENERIC#: foo 0 ( obj -- )" }
+    { $code "GENERIC: foo ( x y z obj -- )" }
+    { $code "GENERIC#: foo 0 ( x y z obj -- )" }
 } ;
 
 HELP: MATH: