syntax-docs: improve descriptions for GENERIC: and GENERIC#:
parent
cf5d0b349c
commit
34e9412e29
|
@ -671,16 +671,16 @@ HELP: NAN:
|
||||||
HELP: GENERIC:
|
HELP: GENERIC:
|
||||||
{ $syntax "GENERIC: word ( stack -- effect )" }
|
{ $syntax "GENERIC: word ( stack -- effect )" }
|
||||||
{ $values { "word" "a new word to define" } }
|
{ $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#:
|
HELP: GENERIC#:
|
||||||
{ $syntax "GENERIC#: word n ( stack -- effect )" }
|
{ $syntax "GENERIC#: word n ( stack -- effect )" }
|
||||||
{ $values { "word" "a new word to define" } { "n" "the stack position to dispatch on" } }
|
{ $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
|
{ $notes
|
||||||
"The following two definitions are equivalent:"
|
"The following two definitions are equivalent:"
|
||||||
{ $code "GENERIC: foo ( obj -- )" }
|
{ $code "GENERIC: foo ( x y z obj -- )" }
|
||||||
{ $code "GENERIC#: foo 0 ( obj -- )" }
|
{ $code "GENERIC#: foo 0 ( x y z obj -- )" }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
HELP: MATH:
|
HELP: MATH:
|
||||||
|
|
Loading…
Reference in New Issue