Git Product home page Git Product logo

Comments (8)

danomatika avatar danomatika commented on September 27, 2024

Do have you sample code to illustrate that this is a bug?

from ofxlua.

alexp-nl avatar alexp-nl commented on September 27, 2024

Yes, but it is embedded in a large project, so it is not very practical to send you this.

But for instance try ofxLua::isFuction on a function in a table. Without the suggested modification you will end up in the ofLogWarning part, when the requested name in reality is a function. If you want, I can create a small example. Only not now, but later this day.

from ofxlua.

danomatika avatar danomatika commented on September 27, 2024

I ask because I don't completely understand the Lua stack api 100%, so I'm curious why this is an issue as it seems to work fine. I also noticed it also seems to work fine if I change all calls within the else statement to LUA_STACK_TOP-1.

from ofxlua.

alexp-nl avatar alexp-nl commented on September 27, 2024

Ok, later this day I'll try to send you a little example. But it boils down to this. The lua_getfield pushes the object on the stack that you want to test if it is a object with the requested type or not. The line after that, you want to test if the previous top of the stack is a table. But you test the current top, not the previous one.

from ofxlua.

danomatika avatar danomatika commented on September 27, 2024

I se the issue using the read test script in luaExample and the following:

// check if testing existence within a table works
lua.pushTable("atable");
ofLogNotice() << "is atable.afunction a function?: " << lua.isFunction("afunction");
lua.popTable();

from ofxlua.

danomatika avatar danomatika commented on September 27, 2024

Let me now if you find any other stack issues like this as I imagine there might be another somewhere.

from ofxlua.

alexp-nl avatar alexp-nl commented on September 27, 2024

Thanks for the correction, I'll keep you informed if I come across other issues.

from ofxlua.

danomatika avatar danomatika commented on September 27, 2024

This fix is also merged into the number branch.

from ofxlua.

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.