[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Some newbie questions
- From: "Virgil Smith" <Virgil@...>
- Date: Thu, 24 Jun 2004 17:42:49 -0500
1. You can register C functions into Lua to be made available to your
scripts.
2. All loaded functions will remain in the Lua state unless specifically
removed.
Functions in Lua are just values assigned to "variables", and will remain
until they are overwritten.
3. The Lua script loading routines (lua_loadfile, etc.) return a function
representing the script. So if particular scripts represent repeatable
operations then you can just load them and assign them to an appropriately
named global variable, then call them when needed.
I hope that makes things clearer.
-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of Boguslaw
Brandys
Sent: Thursday, June 24, 2004 4:34 PM
To: Lua list
Subject: Re: Some newbie questions
Maybe a dumb question,but...
Is it possible to put common functions not in a file but in memory buffer
and some Lua function can locate them when required ? I need load some Lua
scripts from database but common functions should be in memory
buffer/string loaded at program start and always available to scripts.
I'm newbie in Lua.
Boguslaw