Comments (10)
Additionally how do I set a glob val that is == nil / empty?
from rlua.
Never mind
from rlua.
@trsh you're gonna post a good question, figure it out, then leave us hanging?
what'd you find??
from rlua.
@mitchtbaum for the 1st question:
let eval_res = lua.eval::<String>(code, None);
match eval_res {
Ok(val) => {
}
Err(e) => {
}
}
e
will contain Lua errors.
For the nil question, my answer is just not to set that Global. And it will be nil, as all undefined variables in Lua.
from rlua.
@trsh these say to use xpcall. is that another approach?
what about try-catch error handling exception pattern? are these ever used together?
I posted an issue in the framework I'm working on. if you're also interested in actix-web and lua, then I'd love your input.
from rlua.
@mitchtbaum sorry, I can tell nothing more. My approach is working for my project, so i dont investigate further. And I use actix-web.
from rlua.
@mitchtbaum one thing that I wan't, and could not figure out, is how to get print
(printed stuff in lua), to Rust back. If you know that, let me know. For now I throw exceptions to debug stuff.
from rlua.
I'm not sure I understand. what is the goal? to pipe stdout back to Rust? I thought you already showed you can get the error object. Does throwing an exception give different debug output?
from rlua.
I think if it happens anywhere in my code base, it'd be here
that receives strings from Lua to use in Rust code, I think evidenced by its use of push
and push_str()
we're not using it anymore, since we switched to using log.lua
from rlua.
Throwing an exception returns Error to Rust, that includes the error lines. Ok result return whatever you return with "return xx". So Print invisible.
from rlua.
Related Issues (20)
- Possible bug with __newindex not called on numeric indexing HOT 4
- Question: How to exec multiple things at once? HOT 4
- Segfault on clone of #[repr(C)] userdata subfield HOT 9
- ios build error HOT 7
- examples for error handling HOT 2
- Example for eval return a struct? HOT 1
- Cannot load DLLs in v0.19 HOT 6
- Missing mutable borrows for Table<'lua> HOT 2
- Context.create_sequence_from should support references HOT 1
- Undefined symbol lua_checkstack HOT 8
- Crash on empty source HOT 2
- custom runtime path HOT 3
- creating a `require`-able module HOT 8
- [Request] UserData::from_lua HOT 1
- Suggestion: proc_macro for LuaUserDataMethods::add_method HOT 3
- No documentation on how to use LuaRocks with rlua HOT 3
- Rlua + Luarocks Modules -> Fail to load HOT 3
- Memory leak when using system-luajit HOT 2
- Merge with mlua HOT 32
- [Typo] Example says laoded(instead of loaded) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rlua.