[Xapian-discuss] FIXMEs in Search::Xapian

Olly Betts olly at survex.com
Mon Sep 27 14:21:06 BST 2010


On Sun, Sep 05, 2010 at 03:57:23PM +0100, Olly Betts wrote:
> On Fri, Sep 03, 2010 at 05:55:41PM +0100, Tim Brody wrote:
> > According to the GSoC "director"-based callbacks aren't implemented in
> > SWIG? Can SWIG Perl-space callbacks be implemented by hand?
> > (e.g. PerlStopper)
> 
> This is probably the main remaining issue.
> 
> Current releases of SWIG don't support directors for Perl, but there's a
> branch in SWIG SVN where this is implemented, which I believe is in a
> pretty good state now.  Kosei tried it, but there were some problems (I
> don't recall what though) and time was short so we stuck to SWIG trunk.
> It's been about a year now, so whatever was the issue may have been fixed
> anyway.
> 
> It should be possible to do it by hand if necessary (since you can
> generate pretty much whatever wrapping code you want if you write the
> typemaps required), but it would be less code for us to maintain if SWIG
> takes care of it.

I was thinking about this - at least for the simple cases where there's
a single method to override, being able to just pass a subroutine (which can be
anonymous) is probably the most natural API in Perl.  So using directors to
allow subclassing is probably not the best way to go.

For more complex classes like PostingSource, being able to subclass and
override makes more sense though.

Cheers,
    Olly



More information about the Xapian-discuss mailing list