Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Torch, printing any class leads to quitting Lua #40

Closed
jiajunwu opened this issue May 31, 2016 · 3 comments
Closed

In Torch, printing any class leads to quitting Lua #40

jiajunwu opened this issue May 31, 2016 · 3 comments
Assignees
Labels

Comments

@jiajunwu
Copy link

jiajunwu commented May 31, 2016

Ubuntu 14.04

After requiring 'libMalmoLua', if we init a new variable like 'a=AgentHost()', and then simply 'print a', or if you type in an interactive environment ' AgentHost() ', which will try to print the output, the program will crash and quit Lua.

This is possibly because something like a __ tostring() __ function is undefined, but I'm not sure.

@DaveyBiggers
Copy link
Member

It's true that there are no tostring() methods defined for the Malmo objects, though I'm seeing this, rather than the crash you report:

Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> require 'libMalmoLua'
> a=AgentHost()
> print(a)
No such operator defined
stack traceback:
    [C]: ?
    [C]: ?
    [C]: in function 'print'
    stdin:1: in main chunk
    [C]: ?
> 

I'll look into adding tostring() methods to our bindings but for now the workaround is just not to try to print them...

@jiajunwu
Copy link
Author

jiajunwu commented Jun 1, 2016

Hi David,

Yes in lua it's just an error message. In Torch (more like a wrapper over luajit), it leads to a crash.

@DaveyBiggers
Copy link
Member

Fixed by fdc0089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants