Page 1 of 1

read-eval-print

Posted: Tue Sep 15, 2009 6:29 am
by runus
Hello,

in real life I do programm Python. I especially enjoy that interactive console there, which allows me to easily check the effects of singular commands.

is there something similiar to MicroMacro / LUA ?

That is, instead of script/myscriptname.lua I want to be able to enter

printf ("Hello there %s", 200)

and get Hello there 200...

(and later on import singular classes files like rom/classes/player.lua, instantiate my player class and try RomScript("whatever") on the console.

Best wishes,

R.

Re: read-eval-print

Posted: Tue Sep 15, 2009 6:46 am
by Administrator
If you're looking at programming in just Lua, you can download luac Windows binaries from LuaForge. If you are using a different platform, you should compile it yourself (it's very easy under Unix-like OSs!). luac is the basic Lua compiler/interpreter that comes with the Lua library source, so you need to specify to build that extra (read the documentation on this).

If you want to take advantage of MicroMacro functions as well, you can still do that, too. In the 1.0 betas, you can use the 'exec' command by typing in this:

Code: Select all

exec printf("Hello %s\n", "World!");
The only real drawback is you need to keep typing 'exec' in before each line you want to run.

Re: read-eval-print

Posted: Fri Sep 18, 2009 7:45 am
by Sirmabus
Make a script, you can call it "toconsole.lua" or something, with this single line:

Code: Select all

debug.debug()
And run that to put yourself at an interactive console.