lua-users home
lua-l archive

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

Many thanks for the words of wisdom on mutual recursion.
Perhaps I should explain the background of my query.
The semantics of BBC BASIC are very different from
Lua's. The BASIC interpreter keeps a linked list of
function descriptors. As it scans the program source
if it finds a function call it looks to see if it
can find the function's descriptor in the list. If
it cannot, it scans the rest of the program source for
the function's definition, and, if it finds it, adds
the new function descriptor to the list, or raises an
error if it cannot - doing all this before resuming
interpretation. In other words, it is as eager as it can
be to resolve function calls, and that means that
recursion is straightforward.
An old friend of mine, sadly now ill, spent years
writing a much-praised piece of software in BBC
BASIC, in a very modular fashion. The differences in
semantics between Lua and BBC BASIC make rewriting
the software by no means straightforward.
Gavin Wraith (
Home page:
lua-l mailing list --
To unsubscribe send an email to