lua-users home
lua-l archive

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


Hi Minardo,

On 7/9/07, Minardo Gollun Gonzalez Lopez <mgonzalezl@estudiantes.uci.cu> wrote:
I need a code, using Lua5.1.2 that allows me to load a Lua file and print the name of all the functions that have the document. Please any people that have an example or tutorial send It to me because I have not been able to make an example that loads lua and execute it correctly using the latest libraries.

Write to: mgonzalezl@estudiantes.uci.cu   Thank you...

Saludos: Ing. Minardo G. González López.

Start by running this on a Lua interpreter:

 for k,v in pairs(_G) do print(k, type(v)) end

You should see something like this:

 /home/edrx(edrx)# lua51
 Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
 > for k,v in pairs(_G) do print(k, type(v)) end
 string	table
 xpcall	function
 package	table
 tostring	function
 print	function
 os	table
 unpack	function
 ...
 >

Take a look at the "Programming in Lua" book, that is online at
<http://www.lua.org/pil/>, and at the reference manual; I don't
understand what you mean by "all the functions that have the document"
- you need to explain that more clearly, and to tell us how you're
trying to use Lua, your operating system, etc (are you trying to use
it from C without ever having used the interpreter?!?! Ouch!) - if you
want us to be able to help you.

 Cheers,
   Eduardo Ochs
   http://angg.twu.net/