Factor Language Blog

The parse time -vs- run time duality

Wednesday, December 27, 2006

In Factor, anything which can be done via syntax in a source file can also be done at runtime. This lets you construct code on the fly, and define new words with the new code, just as if they were written in a source file:

Task Parsing word Ordinary word
Defining a word : define-compound
Defining a symbol SYMBOL: define-symbol
Defining a generic word GENERIC: define-generic
Defining a generic word G: define-generic*
Defining a method M: define-method
Defining a tuple class TUPLE: define-tuple