Coder Social home page Coder Social logo

Comments (3)

fnuecke avatar fnuecke commented on June 2, 2024

I'm glad if it helps!

What you're probably seeing is the environment your closures are created in being stored as an upvalue of that closure - that environment probably being _G, and therefore containing a bunch of C functions. A quick solution for this (and in most cases a good idea anyway) is to simply throw _G into the permanent values.

In general, I'd recommend eris.settings("path", true) when debugging, in which case it'll tell you exactly where it failed (see the last section in the readme).

Since it can happen that C functions from the global environment are stored somewhere else, directly (e.g. local variables or as upvalues), it can make sense to automatically populate the permanent value table with whatever functions there are in the global environment (directly or indirectly). Here's a snippet that does this, lines 34-67, if you're interested. I've been using this approach (though implemented on the 'host' side) very successfully.

from eris.

krisr avatar krisr commented on June 2, 2024

Thanks so much for the quick reply. Yes, I worked around this exactly as you suggested, but I didn't know about eris.settings("path..., that will be very helpful. I will play around with your snippet as well.

I'm using eris to build a stateful UI library on top of cocoa for my game development tools. It's really neat to be able to launch a handful of new 3D views and slider panels, quit to tweak some C++ rendering code, and relaunch with the exact same UI and views I had.

from eris.

fnuecke avatar fnuecke commented on June 2, 2024

Happy to help. That's a pretty cool use-case, good luck with it!

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.