[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: locals again
- From: Fred Bertsch <fb@...>
- Date: Thu, 11 Dec 1997 11:36:24 -0500 (EST)
On Thu, 11 Dec 1997, Luiz Henrique de Figueiredo wrote:
> I'm interested in what other people think about this "problem".
I'm currently trying to use Lua as an extension language for a video game.
For this, I will need to let users write functions which will be used as
methods in a C++ library. Users will only have to create global
functions, and they will never need to create a global
variable. (Unless they're doing something really horrible.) They will,
however, need to access global variables and functions.
Except for the requirement for a "local" keyword, Lua look like an
ideal language for me. It's reasonably fast, very flexible, and well
thought out. In addition, it looks as though it can be made
somewhat secure. While Java is the obvious choice, I like the size and
simplicity of Lua better.
Obviously, if a large amount of code is going to be written in Lua,
something is going to have to be done to avoid deadly typos caused by
forgetting a "local" somewhere. Of the methods which Russ and you
suggest, I'd have to say that the ideal solution for me would be something
along the lines of the "method" that Russ suggested. This would not break
old code, but would make functions easier to both read and write.
As long as I'm wishing for additions to the language, I'll list one more.
I'm hoping to send precompiled code over the network to execute on client
machines. The only way to do this currently appears to be to save the
code in a file, and then use lua_dofile() on it. In order to avoid
cluttering the filesystem and speed things up, I'd like something
similar to lua_dostring() which executes on a block of precompiled code
which resides in memory. Does anyone know how to do this?