On Wed, Jul 30, 2014 at 11:37 AM, Peter Karman <[email protected]> wrote:

> Or (C) (which Nick suggested to me on irc) is making 'boost' a required
> param, which means the method signature changes but not the method name. I
> like that best.

+1

I agree that making `boost` required is a good solution to this specific
problem.

It is still important to come up with a general solution to the problem
of autogenerated bindings which do not behave quite right.  Our current
hack -- using CFC to autogenerate a "private" helper (i.e. prepended
with an underscore) and then creating a wrapper with the "real" name --
has been revealed as unworkable.  However, that hack is still used in
many places -- see much of Lucy.pm and Clownfish.pm.

Our top priority IMO should be to make things simple for end users of
Lucy and other Clownfish-powered libraries.  It's preferable to tell
users of Lucy::Search::Query that they should override `make_compiler`,
rather than to tell them that `make_compiler` calls a helper which they
need to override.

Conceptually, the simplest approach is to implement all those
clone/_clone, new/_new, make_compiler/_make_compiler pairs in Lucy.pm
and Clownfish.pm as single unified XS functions.   But sometimes that
will be cumbersome, because we may want to use Perl functionality which
is inconvenient to access from C -- like the regex engine.

The underlying issue is that now that Nick has fixed the callback
behavior to invoke the alias (THANK YOU!) `bind_method` should not be
used to create helpers -- only "real" methods.  I suggest a workaround
of creating those private helpers with hand-rolled XS -- which, unlike
abusing `bind_method` for that purpose, will not have the side effect of
changing what Perl-space name gets invoked for callbacks.

Marvin Humphrey

Reply via email to