Wednesday, December 27, 2006

The parse time -vs- run time duality

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:
TaskParsing wordOrdinary word
Defining a word : define-compound
Defining a symbol SYMBOL: define-symbol
Defining a generic wordGENERIC:define-generic
Defining a generic wordG: define-generic*
Defining a method M: define-method
Defining a tuple class TUPLE: define-tuple


Anonymous said...

This sounds a bit like some other language which I've used before but I can't put my finger on it.

Slava Pestov said...

Forth, of course.