On 19 August 2015 at 20:55:32, Olly Betts (olly at survex.com) wrote: On Wed, Aug 19, 2015 at 05:31:31PM +0700, Andreas Marienborg wrote:> If I want to create a patch, should it be against the xapian-bindings > directory/repo? or somewhere else?Against the search-xapian directory of the git repo would be best. Hey, I made a branch from svn/1.2 on github, and tried to forward port? the changes to this branch. I managed to wrap the ValueCountMatchSpy, and write tests to ensure it is working. In the original code there was also some code for PerlMatchSpy, but I did not manage to get this working yet. My XS/C-skills are rather limited unfortunately. If someone with more XS-exerpience could take a look and provide some feedback, that would be great. I created a pull request[1]. I would like to get the PerlMatchSpy thing working as well, but it might be better to get the wrapping of the? ValueCountMatchSpy merged/released regardless of the PerlMatchSpy thing? Any and all feedback is much appreciated :) - a [1]: https://github.com/xapian/xapian/pull/73
On Tue, Aug 25, 2015 at 10:45:12AM +0700, Andreas Marienborg wrote:> If someone with more XS-exerpience could take a look and provide > some feedback, that would be great.Looks plausible to me. I'd suggest that ~Enquire_perl() just call ref_clear_matchspies(NULL); rather than repeating all its code inline.> I created a pull request[1]. I would like to get the PerlMatchSpy thing > working as well, but it might be better to get the wrapping of the? > ValueCountMatchSpy merged/released regardless of the PerlMatchSpy > thing?The classes like perlMatchDecider are there to support passing a code reference in Perl where the C++ API wants a functor object. But Xapian::MatchSpy is rather more than just a function wrapped in a class, so I'm not sure it's very useful to be able to pass a code reference for it. I guess you could store the information gained in a global variable on the perl side. Anyway, just being able to use ValueCountMatchSpy from perl is certainly useful in itself. I'll look at getting this merged soon. Cheers, Olly
On 28 August 2015 at 12:29:56, Olly Betts (olly at survex.com) wrote: On Tue, Aug 25, 2015 at 10:45:12AM +0700, Andreas Marienborg wrote:> If someone with more XS-exerpience could take a look and provide > some feedback, that would be great.Looks plausible to me. I'd suggest that ~Enquire_perl() just call ref_clear_matchspies(NULL); rather than repeating all its code inline. Ahh, yes, I forgot to do that before pushing. Fixed it, and updated the pull request now. Sorry about that.> I created a pull request[1]. I would like to get the PerlMatchSpy thing > working as well, but it might be better to get the wrapping of the? > ValueCountMatchSpy merged/released regardless of the PerlMatchSpy > thing?The classes like perlMatchDecider are there to support passing a code reference in Perl where the C++ API wants a functor object. But Xapian::MatchSpy is rather more than just a function wrapped in a class, so I'm not sure it's very useful to be able to pass a code reference for it. I guess you could store the information gained in a global variable on the perl side. Yeah, I was trying to make it possible to have a Perl class extend a PerlMatchSpy class, and then have that class be called from the XS code on calls to operator for the C class of it, but I got lost in references this way and? that somewhere along the way. Anyway, just being able to use ValueCountMatchSpy from perl is certainly useful in itself. I'll look at getting this merged soon. Thanks, that would be awesome - a