lua-users home
lua-l archive

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


On Fri, Nov 26, 2010 at 12:23 AM, HyperHacker <hyperhacker@gmail.com> wrote:
> #ifdef LUA_HEX
> ...modified line...
> #else
> ...original line...
> #endif

That approach has good qualities like allowing systematic comparison
with the original.

> (IIRC something like all types in a certain range represent
> objects that need garbage collection) and I couldn't figure out how to
> change all such assumptions to accommodate it.

Looks like "#define iscollectable(o) (ttype(o) >= LUA_TSTRING)".

> tl;dr: Agreed, while Lua is a fantastic language, the source code is
> very messy, difficult to understand, and not very patch-friendly.

I sympathize with the difficult to understand part.  Trying to
determine what a piece of code does seems to involve a tree-like
search through inter-dependent code, broadening the search and making
inferences where comments and naming are sparse.  A code browser
obviously helps here.  This has been mentioned in the past [1-2].

[1] http://lua-users.org/lists/lua-l/2008-03/msg00015.html
[2] http://lua-users.org/wiki/LuaSource