Menu

#889 Warn for recursive functions in %extend

None
closed-fixed
5
2022-02-02
2008-01-30
No

It is not possible to call a function recursively that has been added to a class/struct using %extend, since it gets renamed, but the call doesn’t.

A workaround is to declare a static function which does the job using recursion, and to call that function in %extend.

However, the documentation should warn for this. The renaming scheme is mentioned in http://www.swig.org/Doc1.3/SWIGDocumentation.html#SWIG_adding_member_functions, but not explicitly.

See news://news.gmane.org:119/fnkp82$9kl$1@ger.gmane.org and followups for a description of my problem.

Discussion

  • Olly Betts

    Olly Betts - 2008-02-01

    Logged In: YES
    user_id=14972
    Originator: NO

    A patch against the documentation would be most appreciated.

     
  • Olly Betts

    Olly Betts - 2022-02-02
    • status: open --> closed-fixed
    • Group: -->
     
  • Olly Betts

    Olly Betts - 2022-02-02

    Addressed by 11009f8e23faaf8047e00bf93c50f8a70c6d9784 I've just pushed to git master.

     

Log in to post a comment.

Monday.com Logo