SINGLETONS:
Factor documentation > Factor handbook > The language > Objects > Classes > Singleton classes
Prev:SINGLETON:
Next:define-singleton-class ( word -- )


Vocabulary
syntax

Syntax
SINGLETONS: words... ;


Inputs and outputs
wordsa sequence of new words to define


Word description
Creates a new singleton for every token until the ;.

Definition
USING: classes.parser classes.singleton lexer ;

IN: syntax

SYNTAX: SINGLETONS:
";" [ create-class-in define-singleton-class ] each-token ;