lua-users home
lua-l archive

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


Hello!

I'm a new Lua user, and would like to congratulate it's authors on creating such a nice little
package. I'm replacing the scripting language in a Windows multimedia authoring app
(http://www.mediachance.com) and Lua is my top contender so far.

I have a couple questions, please forgive me if they are totally naive...

· Much of the real-world Lua code I've seen requires a function to copy a table.  I had planned to
include a clone() function (written in C) for my users, but I am worried that there is a good
reason one doesn't already exist in the standard library.  Is there?

· I originally discovered that Lua discards all but the first return value of a function when used
in an argument list (unless it's the last or only arg) by accident, when trying to do something
like:

   drawtext (pos:xy(), text)

where xy() returns the x and y of a Point. It seems to me that using all the return values would
be what one would expect.  Discarding values in this one situation seems inconsistent. Why the
special case? Does it make Lua's implementation easier? Are there idioms where this is genuinely
useful?  Any chance this will change in future versions?

· I'm trying to find examples of using object-oriented syntax to manipulate objects in the host
app.  Most of the stuff I've found online is for Lua 3.x.  Can someone direct me to a
straightforward example of exporting class hierarchies (rather than function libraries) to Lua
4.0?

Cheers,
Eric



__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/