lua-users home
lua-l archive

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


On 8/23/07, David Given <dg@cowlark.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Difficult to say without seeing the C code. However, from your description, it
> sounds very likely that you're compiling-and-running the script three times
> (which will redefine remember to {} each time), rather then
> compiling-and-running it *once* (to define remember and check_memory()), and
> then calling check_memory() three times.

I believe I see what you mean. I included the C code in my earlier
reply for your perusal, however I am not aware of any other methods of
obtaining the results I require other than what I have already
attempted.

>
> Assuming Lua 5.1, luaL_dofile() compiles and runs the code; and then you can
> do lua_getglobal()/lua_pcall() to actually fetch and run the check_memory()
> function.
>
> Does this help, any?
>

It does help tremendously. It tells me that I have absolutely no idea
what I am doing :-P
I have been writing C programs for nearly a decade now with no formal
training, and lua is the second language I have attempted to pick up.
My thought processes are not trained to understand dynamically-typed
languages and I may need to be spoon-fed until I can rip out the past
9 years of constant C.

Anyway, any help you can provide will be greatly appreciated.

-Shane
p.s. Yes, I am using the 5.1 version of Lua, locally compiled from
source for my specific computer (SuSE 10.2).