No subject


Mon Jan 18 11:22:38 PST 2010


  use KinoSearch;

The great bulk of the functionality resides in a single XS shared object.
Where there needs to be Perl code, it's in KinoSearch.pm.  All the other .pm
are stubs that just load KinoSearch.pm.

Classes under "KSx::" distributed with KinoSearch need to be loaded as usual:

  use KSx::Remote::SearchServer;

(We should probably make the loading scheme a formal part of the API.  If we
dropped that convention now, various scripts would start breaking because
people had forgotten use directives but things still worked.  And it sure does
make things easier.)

> I'm wondering if there is a reason that "provides" is incomplete, both
> in terms of this module and generally speaking.  

Based on the contents of "provides" in the 0.30_072 tarball, it looks it gets
generated via a source code scan of .pm files under lib/ for package
declarations.  (Hmm, I wonder how it handles package declarations in sample
code within POD blocks.)  Thus the only classes that get listed are the ones
which for whatever reason needed to be fleshed out with Perl code in
KinoSearch.pm.  That doesn't include e.g. KinoSearch::Searcher, since Searcher
is completely implemented via C/XS these days.

I believe we solve this problem by adding package declarations to our stubs:

Index: lib/KinoSearch/Searcher.pm
===================================================================
--- lib/KinoSearch/Searcher.pm  (revision 5735)
+++ lib/KinoSearch/Searcher.pm  (working copy)
@@ -1,3 +1,4 @@
+package KinoSearch::Searcher;
 use KinoSearch;
  
1;


I've added that to our TODO list for 0.30_08.

> Is "provides" expected to list every class/.pm provided by a given module?

I suspect it only *needs* the public classes, at least to fix your problem.

However, it wouldn't be that much of a pain to generate a complete list of
private classes.  We could either scan all the Clownfish files (currently with
.bp extensions under trunk/core/) for class declarations, or rely on the
Clownfish compiler itself and ask it to list all the classes it found.

Marvin Humphrey





More information about the kinosearch mailing list