Git Product home page Git Product logo

Comments (4)

fnuecke avatar fnuecke commented on September 2, 2024

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.

SirVer avatar SirVer commented on September 2, 2024

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.

fnuecke avatar fnuecke commented on September 2, 2024

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.

SirVer avatar SirVer commented on September 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.