lua-users home
lua-l archive

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


Hi Thiago,

thiago wrote:
Usually print problems related to luajava are due to java stdout
buffering. Try flushing Lua's stdout.
Just a question. You are trying to print to console, right? If you are
trying to print to a swing window, you have to explicitly do that
(there is an example in the test code with the distribution).

I have redirected stdout through System.setErr() and System.setOut(), but I think it worked the same even before that. But providng my own print function isn't that bad.

Yes, it's probably due to your print not working. If pcall returns a
value, it is in the stack. Same as pcall in Lua. You can get the value
using the stack functions.

I think it was mainly a misunderstanding from my side. I thought the interactive mode works like irb for Ruby or Python, like:

> 1 + 4
5
> foo()
"hello world"

But now I know it doesn't so I don't have to recreate it in my Swing shell. Too bad Lua doesn't have implicit returns :-)

Cheers,
 Jonas