#1110 Strange behaviour on method names containing underscores (_)

closed-works-for-me
ruby (61)
5
2011-02-05
2010-10-13
No

I have a class which contains a method whose name is "somethingCool_Fast". The generated Ruby interface, however, doesn't have a method named "somethingCool_Fast". Instead, the method name is "somethingFast" there, i.e. the part "Cool_" of the name is missing. This issue appears in SWIG-2.0.0 as well as SWIG-2.0.1.

Discussion

  • William Fulton

    William Fulton - 2011-02-05
    • assigned_to: gga73 --> wsfulton
    • status: open --> closed-works-for-me
     
  • William Fulton

    William Fulton - 2011-02-05

    I tried this:

    %module example

    %inline %{
    class Tst {
    public:
    int somethingCool_Fast(int i) { return i*2; }
    };
    %}

    require 'example'
    c = Example::Tst.new()
    print "result = ", c.somethingCool_Fast(22), "\n"

    which works as expected. Probably you have something else in your code changing the name... a macro or %rename perhaps? Closing, please open if you can recreate with an example.

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks