lua-users home
lua-l archive

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


> How do other people deal with forward declarations?

I tend to define any function before using it, so I only need a forward
declaration when the code has indirect recursion. Even in that case,
I try to minimize the backward edges in the call graph. (For instance,
the Lua parser has only two forward declarations, one for 'expr'
(expressions) and one for 'statement', which correspond to the main
recursive non-terminals in the grammar.)

In the few cases left, I think comments should be enough.

-- Roberto