VocabularysyntaxSyntaxGENERIC# word n ( stack -- effect )
Inputs and outputs| word | a new word to define |
| n | the stack position to dispatch on |
Word descriptionDefines a new generic word which dispatches on the
nth most element from the top of the stack in the current vocabulary. Initially, it contains no methods, and thus will throw a
no-method error when called.
NotesThe following two definitions are equivalent:
GENERIC: foo ( obj -- )
GENERIC# foo 0 ( obj -- )
See alsogeneric,
define-generic,
define-simple-generic,
GENERIC:,
MATH:,
HOOK:Definition