You. Forth. Simplicity.

git repository
download
prior releases
documentation wiki
issue tracker
mailing list and forum
irc channel and logs
try it


This wiki remains, like the original forum, mainly for historical value. There is a new wiki which, while having less content, is more secure and oriented towards modern Retro implementations.

reload node | edit | recent changes | front page

An alias is simply a new dictionary entry for a given word. This procedure uses a word's execution token, i.e. the address of it's compiled code. "alias foo" takes an xt from the stack, and creates a word in the dictionary named foo.

This is useful in conjunction with anonymous functions, which lack a dictionary entry to begin with. It is also useful (along with ') for creating two identical words without wasting codespace.


( this wastes 5 bytes on the heap: )
: foo .s words ;
: bar foo ;
( however, this does not: )
: foo .s words ;
' foo alias bar
( nor does this: )
:: .s words ;
dup alias foo alias bar

In the first example, a total of two functions are created and given the names 'foo' and 'bar'. In the second and third examples, one function is created and is given two different names.

'alias' is useful with the loc: and ;loc tags, which remove names from the dictionary, because usually you will want to create at least one word from the code contained within them. 'alias' is interchangable with 'is' in most instances, the exception being that 'alias' always creates a new word name, whereas 'is' will change the vector of an existing word.