[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: c &lua integration
- From: "Nick Trout" <nick@...>
- Date: Wed, 16 Jul 2003 10:49:50 -0700
> Because i wanted a less crappy way of doing it.. one using the lua api
and
> not lua scripting features..
>
> Even though lua seems like a great scripting language, its lacking
some
> expected features. From a c program you can't take control of the
> execution neither the local variables.
What can't you control from the C side? I'm not aware of anything you
can't do from C that you can do in script? I prototype in Lua and
optimise back and haven't had any problems yet.
Actually I think you can get locals by setting a functions environment
(read about setfenv()) - I have not verified this - sorry no time.
Search the lua-l archives.
> The examples doesnt show how to take control of the lua script, but
rather
> how to write the lua script to give the host program some degree of
> control. I can ofcourse preprosess and "insert" the control code, but
i
> just didnt at first believed the degree of lacking control from the
host
> program..
Lua gives you the ability to set up your system how you like. There is
no specific architecture or way of doing things that you need to know. I
know vaguely how VB works and what you are trying to do and you could
set up a system to do this, it's just not done for you. Lua is a pretty
"bare bones", stripped down scripting system, but it is highly
configurable and very flexible, you just have to know how to use it.
Read the Lua tutorial, give it a bit of time and you might find what you
want.
Regards,
Nick