PreviousNext
Help > EXTREME PROGRAMMING WITH RITTLE > Function Variables > Using Function Variables
Using Function Variables

In the previous example a function variable named “myvar” was declared, and initialised to point to the function foo(). Anywhere in the program from that point further, the name “myvar” will cause the function foo() to be called.

If at certain point myvar needs to point to another function, it can be re-initialised:

myvar = @newfoo;

This will change “myvar” to point to the function newfoo() instead.