:
Factor handbook > The language > Words > Colon definitions

Next:; ( -- * )


Vocabulary
syntax

Syntax
: word ( stack -- effect ) definition... ;


Inputs and outputs
worda new word to define
definitiona word definition


Word description
Defines a word with the given stack effect in the current vocabulary.

Examples
: ask-name ( -- name ) "What is your name? " write readln ; : greet ( name -- ) "Greetings, " write print ; : friend ( -- ) ask-name greet ;


See also
;, define

Definition