RE:

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RE:

Minardo Gollun Gonzalez Lopez
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: [hidden email]   Thank you...

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

<<winmail.dat>>

Reply | Threaded
Open this post in threaded view
|

RES:

Rafael - SosCpdTerra
Again or still?? :-)

 

function fn_exists (funcname)

            return (type (getglobal (funcname)) == "function");

end

 

Haven't use this, but the concept is that way. This looks like homework to
me.

 

 

 

  _____  

De: [hidden email]
[[hidden email]] Em nome de Minardo Gollun
Gonzalez Lopez
Enviada em: segunda-feira, 9 de julho de 2007 10:00
Para: [hidden email]
Assunto: RE:
Prioridade: Alta

 

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: [hidden email]   Thank you...

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

__________ NOD32 2385 (20070709) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



<<attachment: winmail.dat>>

Reply | Threaded
Open this post in threaded view
|

Re:

Eduardo Ochs
In reply to this post by Minardo Gollun Gonzalez Lopez
Hi Minardo,

On 7/9/07, Minardo Gollun Gonzalez Lopez <[hidden email]> 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: [hidden email]   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/