<commit_before>USING: definitions help.markup help.syntax kernel parser
kernel.private words.private vocabs classes quotations
strings effects compiler.units ;
IN: words

ARTICLE: "interned-words" "Looking up and creating words"
"A word is said to be " { $emphasis "interned" } " if it is a member of the vocabulary named by its vocabulary slot. Otherwise, the word is " { $emphasis "uninterned" } "."
$nl
"Words whose names are known at parse time -- that is, most words making up your program -- can be referenced in source code by stating their name. However, the parser itself, and sometimes code you write, will need to create look up words dynamically."
$nl
"Parsing words add definitions to the current vocabulary. When a source file is being parsed, the current vocabulary is initially set to " { $vocab-link "scratchpad" } ". The current vocabulary may be changed with the " { $link POSTPONE: IN: } " parsing word (see " { $link "vocabulary-search" } ")."
{ $subsection create }
{ $subsection create-in }
{ $subsection lookup } ;

ARTICLE: "uninterned-words" "Uninterned words"
"A word that is not a member of any vocabulary is said to be " { $emphasis "uninterned" } "."
$nl
"There are several ways of creating an uninterned word:"
{ $subsection <word> }
{ $subsection gensym }
{ $subsection define-temp } ;

ARTICLE: "colon-definition" "Word definitions"
"Every word has an associated quotation definition that is called when the word is executed."
$nl
"Defining words at parse time:"
{ $subsection POSTPONE: : }
{ $subsection POSTPONE: ; }
"Defining words at run time:"
{ $subsection define }
{ $subsection define-declared }
{ $subsection define-inline }
"Word definitions should declare their stack effect, unless the definition is completely trivial. See " { $link "effect-declaration" } "."
$nl
"All other types of word definitions, such as " { $link "symbols" } " and " { $link "generic" } ", are just special cases of the above." ;

ARTICLE: "symbols" "Symbols"
"A symbol pushes itself on the stack when executed. By convention, symbols are used as variable names (" { $link "namespaces" } ")."
{ $subsection symbol }
{ $subsection symbol? }
"Defining symbols at parse time:"
{ $subsection POSTPONE: SYMBOL: }
"Defining symbols at run time:"
{ $subsection define-symbol }
"Symbols are just compound definitions in disguise. The following two lines are equivalent:"
{ $code
    "SYMBOL: foo"
    ": foo \\ foo ;"
} ;<commit_msg>Minor doc clarification<commit_after>USING: definitions help.markup help.syntax kernel parser
kernel.private words.private vocabs classes quotations
strings effects compiler.units ;
IN: words

ARTICLE: "interned-words" "Looking up and creating words"
"A word is said to be " { $emphasis "interned" } " if it is a member of the vocabulary named by its vocabulary slot. Otherwise, the word is " { $emphasis "uninterned" } "."
$nl
"Words whose names are known at parse time -- that is, most words making up your program -- can be referenced in source code by stating their name. However, the parser itself, and sometimes code you write, will need to create look up words dynamically."
$nl
"Parsing words add definitions to the current vocabulary. When a source file is being parsed, the current vocabulary is initially set to " { $vocab-link "scratchpad" } ". The current vocabulary may be changed with the " { $link POSTPONE: IN: } " parsing word (see " { $link "vocabulary-search" } ")."
{ $subsection create }
{ $subsection create-in }
{ $subsection lookup } ;

ARTICLE: "uninterned-words" "Uninterned words"
"A word that is not a member of any vocabulary is said to be " { $emphasis "uninterned" } "."
$nl
"There are several ways of creating an uninterned word:"
{ $subsection <word> }
{ $subsection gensym }
{ $subsection define-temp } ;

ARTICLE: "colon-definition" "Word definitions"
"Every word has an associated quotation definition that is called when the word is executed."
$nl
"Defining words at parse time:"
{ $subsection POSTPONE: : }
{ $subsection POSTPONE: ; }
"Defining words at run time:"
{ $subsection define }
{ $subsection define-declared }
{ $subsection define-inline }
"Word definitions should declare their stack effect, unless the definition is completely trivial. See " { $link "effect-declaration" } "."
$nl
"All other types of word definitions, such as " { $link "symbols" } " and " { $link "generic" } ", are just special cases of the above." ;

ARTICLE: "symbols" "Symbols"
"A symbol pushes itself on the stack when executed. By convention, symbols are used as variable names (" { $link "namespaces" } ")."
{ $subsection symbol }
{ $subsection symbol? }
"Defining symbols at parse time:"
{ $subsection POSTPONE: SYMBOL: }
"Defining symbols at run time:"
{ $subsection define-symbol }
"Symbols are just compound definitions in disguise. The following two lines are equivalent:"
{ $code
    "SYMBOL: foo"
    ": foo ( -- value ) \\ foo ;"
} ;
{'fraction_non_alphanumeric': 0.10425575239258807, 'fraction_numerical': 0.0, 'mean_word_length': 4.46384872080089, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4412344', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1367, 'n_words': 629}