[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Line numbers and finite-state machines in LISP



Actually, I have always found it most convenient to express
finite-state machines in LISP by using mutually recursive
functions, passing the state around as an argument.  This is
the main programming-style reason for wanting a tail-recursive
implementation.  If LABELS is available to package up these
functions, so much the better.  If the state is too
unwielfy to pass as arguments, then PROG is fine, more or less.

As for GOSUB, functional variables 
seem to be an easy way to express that idea.  Smart compilers
(ha!) can figure them out and use JSP instead of PUSHJ even, though
it is indeed a lot of work.  But if we lobby for the labnguage
feature and it gets used a lot, then eventually the compiler *will*
become smart enough... if we wantg it to be that way (a subject for debate).