Comments (4)
That is indeed deliberate, because Eris can't (or rather shouldn't [IMHO]) decide on its own what to do if values it needs for unpersisting a state are missing, following the principle of least surprise.
If the values exposed in debug mode are all functions you can take the lazy approach: slap a setmetatable(uperms, {__index=function()return function()end end})
on your permanent value table, automatically returning a dummy function for all missing values.
The cleaner, but more verbose approach would be to manually provide the same values you have in debug mode in the permanent value table, but have them do nothing (i.e. have all functions be dummy functions, all numbers be 0xDEADBEEF, all strings be "debug only" or something).
Alternatively, assuming that wouldn't break things left-and-right anyway, a new setting might be an option, controlling Eris' behavior on missing permanent values (error - the current behavior - or replace the value with nil
; non-nil values would still have to be handled via __index
, e.g.).
from eris.
If the values exposed in debug mode are all functions...
They are not, they are lua tables though. But just pushing empty tables did not do the trick, the problem was the same:
lua_newtable(m_L); lua_setglobal(m_L, "package");
lua_newtable(m_L); lua_setglobal(m_L, "io");
lua_newtable(m_L); lua_setglobal(m_L, "os");
any more ideas?
from eris.
Sounds very much like what I described here. You'll probably have to add the actual functions to the perms table, not just the table containing them.
from eris.
mmh.. that is what I've thought. I decided to just remove this conditional loading of libraries. I never had any use for them in the last year anyways, so they are probably not as useful. Thanks for your explanations!
from eris.
Related Issues (20)
- Potential crash when persisting threads HOT 1
- Eris for Lua 5.3 HOT 5
- Persisting threads and the global environment HOT 9
- some lua unit test failures when using `make mingw` with latest eris release (1.1.0-5.3) HOT 3
- Linking issue when compiling eris as C++ caused by "typedef int bool" HOT 1
- Please update the project description HOT 1
- Memory limit HOT 2
- Internals of eris HOT 2
- What's meaning of invalid reference error?
- Memory corruption was detected in ERIS HOT 15
- Bug HOT 1
- upvalues in global functions to local variables not restored properly HOT 4
- Literal persistance of userdata HOT 1
- What is the purpose of persisting iolib and loadlib? HOT 2
- LuaJIT support HOT 1
- No issue, but seemingly the only way to reach you :) HOT 2
- Two upvalue related bugs HOT 3
- attempt to persist a light C function? HOT 3
- How to navigate invalid reference errors? HOT 7
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 eris.