lua-users home
lua-l archive

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


Couple of random comments and experiences in converting an existing
project:

  +  luadebug.h doesn't have single-state macros, is this intentional?

  +  You have exposed the name "TObject" in lua.h to define lua_Object. 
Borland C++ Builder uses "TObject" as the great-grand-daddy class of just
about everything.  That hasn't yet caused me a problem because my use of
Lua keeps it pretty isolated from the Builder object heirarchy.  But it
could present a problem in the future should I need access to both in the
same code module.

  I think you should stick with the "lua_" naming convention you've
established in the public headers.

  Possible solution:  inside the private lobject.h add "typedef struct
TObject lua_TObject" then inside the public lua.h use lua_TObject to
typedef lua_Object.  A bit redundant, but name safe.

  +  The "for" loop is welcome.  I have lots of constructs similar to..

  local i=1
  while i <= n do
    whatever(i)
    i=i+1
  end

  ..so am quite happy to finally be able to code "for i=1,n do whatever(i)
end".  :-)  That covers 90% of what I'd use a for loop for.

  +  I too typically code "for (int i=...)" in C++, so the local var in the
for statement presents no learning curve or coding oddity for me.

  +  I don't yet have a use for the break statement, so no comments on its
implementation.  It's nice to know that it's there though, just in case.

  +  Object code is marginally larger in 4.0, but still tiny compared to
most things.  My lua.lib file went from 65k to 74k, lualib.lib from 19k to
21k.  Figure about 5k of static overhead if trying to figure percentages.

  +  Had to clean up some sloppy code where I had used int's instead of
lua_Object's.  Oops.  ;-)

  +  Had to add lots of const's before char *'s.

  +  Had to fix a Lua-based gc tag method.  It frustrated me at first to
get that deprecated message, but after being force to rework the code I
realized that I should have been doing that way even with 3.2.


  Cheers,

  Dave