[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [NOOB] "remember" function
- From: David Given <dg@...>
- Date: Thu, 23 Aug 2007 20:40:59 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Shane Lee wrote:
[...]
> Now then, here's the problem; Whenever I attempt to duplicate the
> above result using a C call, it constantly "forgets" the last table
> entry and no matter how many times I make the call, it returns:
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.
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?
- --
┌── dg@cowlark.com ─── http://www.cowlark.com ───────────────────
│
│ "There does not now, nor will there ever, exist a programming language in
│ which it is the least bit hard to write bad programs." --- Flon's Axiom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGzeLLf9E0noFvlzgRAt/SAKCiSEzbMQv4mfqoWOtlXXCmUP7+1wCfQ9e5
8RhaxcxSh8yvngLFY8dU0JM=
=sIW5
-----END PGP SIGNATURE-----