#260 Disown, better string output, and factory typemap for Lua

general (37)

I added some functions to the Lua runtime to allow for better string output (showing the class of the userdata) and for manual disowning by the runtime. I contacted Mark Gossage about these changes, but haven't heard back from him.


  • William Fulton

    William Fulton - 2011-03-17

    Mark is no longer doing any development work. I will add this patch though if you add or modify one of the _runme.lua files under Examples/test-suite/lua for testing the changes. See http://www.swig.org/Doc2.0/Extending.html#Extending_test_suite for test-suite notes.

  • Shane Liesegang

    Shane Liesegang - 2011-03-18

    Thanks William. Would it be sufficient to have a test that simply asserts, after manually calling disown, that the ownership flag has been cleared on the scripting side, or would you want something that interacts with the wrapped class more, to show what might go wrong without having this ability?

  • William Fulton

    William Fulton - 2011-03-29

    Either approach works. The Lua test-suite has many asserts, so taking the same approach would work well.

  • Shane Liesegang

    Shane Liesegang - 2011-04-14
    • summary: Disown and better string output for Lua --> Disown, better string output, and factory typemap for Lua
  • Shane Liesegang

    Shane Liesegang - 2011-04-14

    I've submitted a new patch file that includes tests for the new functionality. A few potential caveats:

    1) I added some code to the base disown.i file to allow testing when B directly deletes A. All existing test suites still passed with this added code.

    2) I've also added in the factory typemap from Lua, adapted from the Python version of the same typemap. Tests included.

    3) I wasn't sure how best to test the string output -- it really only comes into play with Lua's build in print() function, which outputs directly to the console, making testing difficult.

  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-02-24

    I realize this is a bit late, but I had posted an updated version of the patch a while back. I thought that would be enough to trigger another review, but I guess I should have done a comment as well.

  • William Fulton

    William Fulton - 2012-04-13

    Thanks for the updated patch and the tests are much appreciated. Sorry for taking a while to look at this, but we havn't made a release in ages. Although I'm not that familiar with Lua, I have applied this for swig-2.0.5 as the tests look reasonable and nothing seems broken.

  • William Fulton

    William Fulton - 2012-04-13
    • assigned_to: nobody --> wsfulton
    • status: open --> closed-accepted

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks