Crawler Tractor

Example of the self-processing Lisp program is
presented. The function
f, written in Newlisp dialect
of Lisp, continously increments the value of the variable counter and prints its value. However, implementation of
f doesn't
contain a loop or recursion. Instead, the function changes the code of its
definition during evaluation.

Hi for the 1. time.
Hi for the 2. time.
Hi for the 3. time.
Hi for the 4. time.
...

The evaluation reminds on the work of the crawler tractor,
popular construction
vehicle. Initially, interpreter encountered "stack overflow" after
counter
was incremented few hundreds of thousands
times. Lutz
Mueller, the author of Newlisp promptly resolved the issue. The speed
penalty was, according to Mueller, very low.

As a proof of the concept, Joel Ericson defined two factorial functions that evaluate on
similar way. In one of these even variables are not used.