On Mon, 8 Dec 2014 11:37:16 +0100 Arvin Schnell <[email protected]> wrote:
> On Fri, Dec 05, 2014 at 03:37:02PM +0100, Arvin Schnell wrote: > > On Fri, Dec 05, 2014 at 02:06:26PM +0100, Martin Vidner wrote: > > > On Wed, Dec 03, 2014 at 11:07:34AM +0100, Arvin Schnell wrote: > > > > Bindings > > > > -------- > > > > > > > > I have swig generated bindings for Ruby, Python and Perl5. The > > > > repository contains a few examples for each of them: > > > > Similarly, though less automatable, it would be good to rename > > > getters and setters: > > > http://www.swig.org/Doc3.0/Ruby.html#Ruby_nn31 > > > > > > - partition.getNumber() > > > + partition.number > > > > Well, that's indeed a lot of work. Having to take care of three > > bindings I think it's too much. Also I want to keep the SWIG > > interface file identical for all three bindings if possible. > > Maybe it's not that much work after all since rename supports > regexs, an example from the documentation: > > %rename("%(regex:/^(Set|Get)(.*)/\\2/)s") ""; > > But then the autorename does not work anymore and I couldn't > figure out how to get it working. > > I asked Klaus about this. He takes a different approach with > Swig, starting with an empty interface description and then > adding what is needed specially tailored for the target language. > The result is nicer bindings at the cost of some extra work. > > I'm considering using that approach but I will need someone for > every target language tailoring the bindings and extending the > (now existing) testsuites. > > Regards, > Arvin > If you use Klaus approach, then I think it is better to not use at all SWIG and write directly ruby bindings. For C++ it can help to use rice[1][2]. Josef [1] https://github.com/jasonroelofs/rice [2] http://www.ibm.com/developerworks/library/os-extendruby/ -- To unsubscribe, e-mail: [email protected] To contact the owner, e-mail: [email protected]
