You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2012/01/24 05:15:59 UTC

[lucy-commits] svn commit: r1235130 [1/2] - in /incubator/lucy/trunk: clownfish/perl/lib/Clownfish/ clownfish/perl/lib/Clownfish/CFC/Binding/Perl/ clownfish/src/ perl/buildlib/Lucy/Build/Binding/ perl/buildlib/Lucy/Build/Binding/Index/ perl/buildlib/Lucy/Build/Bindin...

Author: marvin
Date: Tue Jan 24 04:15:59 2012
New Revision: 1235130

URL: http://svn.apache.org/viewvc?rev=1235130&view=rev
Log:
Break up class binding specs.

Remove the bind_constructors and bind_methods arguments from
Clownfish::CFC::Binding::Perl::Class#new, forcing usage of bind_constructor()
and bind_method() routines.

Modified:
    incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC.pm
    incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm
    incubator/lucy/trunk/clownfish/src/CFCPerlClass.c
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Analysis.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Document.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Highlight.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index/Posting.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Lucy.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Plan.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search/Collector.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Store.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Test/Util.pm
    incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Util.pm
    incubator/lucy/trunk/perl/buildlib/LucyX/Build/Binding/Search.pm

Modified: incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC.pm (original)
+++ incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC.pm Tue Jan 24 04:15:59 2012
@@ -637,8 +637,6 @@ BEGIN { XSLoader::load( 'Clownfish::CFC'
     our %new_PARAMS = (
         parcel            => undef,
         class_name        => undef,
-        bind_methods      => undef,
-        bind_constructors => undef,
         make_pod          => undef,
         xs_code           => undef,
         client            => undef,
@@ -653,19 +651,11 @@ BEGIN { XSLoader::load( 'Clownfish::CFC'
         confess("Missing required param 'class_name'")
             unless $args{class_name};
 
-        # Retrieve Clownfish::CFC::Class client, if it will be needed.
-        my $client;
-        if (   $args{bind_methods}
-            || $args{bind_constructors}
-            || $args{make_pod} )
-        {
-            $args{client} = Clownfish::CFC::Class->fetch_singleton(
-                parcel     => $args{parcel},
-                class_name => $args{class_name},
-            );
-            confess("Can't fetch singleton for $args{class_name}")
-                unless $args{client};
-        }
+        # Retrieve Clownfish::CFC::Class client, if available.
+        $args{client} ||= Clownfish::CFC::Class->fetch_singleton(
+            parcel     => $args{parcel},
+            class_name => $args{class_name},
+        );
 
         # Create Pod spec if needed.
         my $pod_spec;
@@ -674,32 +664,8 @@ BEGIN { XSLoader::load( 'Clownfish::CFC'
                 %{ $args{make_pod} } );
         }
 
-        # Create object.
-        my $self = _new( @args{qw( parcel class_name client xs_code )},
+        return _new( @args{qw( parcel class_name client xs_code )},
             $pod_spec );
-
-        my $meth_list = $args{bind_methods} || [];
-        for my $meth_namespec (@$meth_list) {
-            my ( $alias, $name )
-                = $meth_namespec =~ /^(.*?)\|(.*)$/
-                ? ( $1, $2 )
-                : ( lc($meth_namespec), $meth_namespec );
-            $self->bind_method( alias => $alias, method => $name );
-        }
-
-        my $cons_list = $args{bind_constructors} || [];
-        for my $cons_namespec (@$cons_list) {
-            my ( $alias, $initializer )
-                = $cons_namespec =~ /^(.*?)\|(.*)$/
-                ? ( $1, $2 )
-                : ( $cons_namespec, undef );
-            $self->bind_constructor(
-                alias       => $alias,
-                initializer => $initializer,
-            );
-        }
-
-        return $self;
     }
 
     our %bind_method_PARAMS = (

Modified: incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm (original)
+++ incubator/lucy/trunk/clownfish/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm Tue Jan 24 04:15:59 2012
@@ -35,7 +35,6 @@ Clownfish::CFC::Class.
         parcel       => 'MyProject' ,                         # required
         class_name   => 'Foo::FooJr',                         # required
         bind_methods => [qw( Do_Stuff _get_foo|Get_Foo )],    # default: undef
-        bind_constructors => [qw( new _new2|init2 )],         # default: undef
         make_pod          => [qw( get_foo )],                 # default: undef
         xs_code           => undef,                           # default: undef
     );
@@ -60,11 +59,6 @@ method-naming convention.  The Perl subr
 lowercasing C<Method_Name> to C<method_name>, but this can be overridden by
 prepending an alias and a pipe: e.g. C<_get_foo|Get_Foo>.
 
-=item * B<bind_constructors> - An array of constructor names.  The default
-implementing function is the class's C<init> function, unless it is overridden
-using a pipe-separated string: C<_new2|init2> would create a Perl subroutine
-"_new2" which would invoke C<myproj_FooJr_init2>.
-
 =item * B<make_pod> - A specification for generating POD.  TODO: document this
 spec, or break it up into multiple methods.  (For now, just see examples from
 the source code.)

Modified: incubator/lucy/trunk/clownfish/src/CFCPerlClass.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCPerlClass.c?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCPerlClass.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCPerlClass.c Tue Jan 24 04:15:59 2012
@@ -173,17 +173,27 @@ CFCPerlClass_bind_method(CFCPerlClass *s
     self->meth_aliases[self->num_methods] = (char*)CFCUtil_strdup(alias);
     self->meth_names[self->num_methods]   = (char*)CFCUtil_strdup(method);
     self->num_methods++;
+    if (!self->client) {
+        CFCUtil_die("Can't bind_method %s -- can't find client for %s",
+                    alias, self->class_name);
+    }
 }
 
 void
 CFCPerlClass_bind_constructor(CFCPerlClass *self, const char *alias,
                               const char *initializer) {
+    alias       = alias       ? alias       : "new";
+    initializer = initializer ? initializer : "init";
     size_t size = (self->num_cons + 1) * sizeof(char*);
     self->cons_aliases = (char**)REALLOCATE(self->cons_aliases, size);
     self->cons_inits   = (char**)REALLOCATE(self->cons_inits,   size);
     self->cons_aliases[self->num_cons] = (char*)CFCUtil_strdup(alias);
     self->cons_inits[self->num_cons]   = (char*)CFCUtil_strdup(initializer);
     self->num_cons++;
+    if (!self->client) {
+        CFCUtil_die("Can't bind_constructor %s -- can't find client for %s",
+                    alias, self->class_name);
+    }
 }
 
 CFCPerlMethod**

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Analysis.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Analysis.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Analysis.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Analysis.pm Tue Jan 24 04:15:59 2012
@@ -33,10 +33,10 @@ sub bind_analyzer {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::Analyzer",
-        bind_methods      => [qw( Transform Transform_Text Split )],
-        bind_constructors => ["new"],
         make_pod          => { synopsis => "    # Abstract base class.\n", }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Transform Transform_Text Split );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -56,12 +56,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::CaseFolder",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -87,12 +87,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::EasyAnalyzer",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -132,9 +132,9 @@ END_XS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Analysis::Inversion",
-        bind_methods => [qw( Append Reset Invert Next )],
         xs_code      => $xs,
     );
+    $binding->bind_method( method => $_ ) for qw( Append Reset Invert Next );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -158,12 +158,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::Normalizer",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor }
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -197,14 +197,14 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::PolyAnalyzer",
-        bind_constructors => ["new"],
-        bind_methods      => [qw( Get_Analyzers )],
         make_pod          => {
             methods     => [qw( get_analyzers )],
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Analyzers );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -234,12 +234,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::RegexTokenizer",
-        bind_constructors => ["_new"],
         make_pod          => {
             constructor => { sample => $constructor },
             synopsis    => $synopsis,
         },
     );
+    $binding->bind_constructor( alias => '_new' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -262,12 +262,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::SnowballStemmer",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor }
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -295,12 +295,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::SnowballStopFilter",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor }
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -320,12 +320,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Analysis::StandardTokenizer",
-        bind_constructors => ["new"],
         make_pod          => {
             constructor => { sample => $constructor },
             synopsis    => $synopsis,
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -389,16 +389,14 @@ END_XS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Analysis::Token",
-        bind_methods => [
-            qw(
-                Get_Start_Offset
-                Get_End_Offset
-                Get_Boost
-                Get_Pos_Inc
-                )
-        ],
         xs_code => $xs,
     );
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Start_Offset
+        Get_End_Offset
+        Get_Boost
+        Get_Pos_Inc
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Document.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Document.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Document.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Document.pm Tue Jan 24 04:15:59 2012
@@ -95,13 +95,13 @@ END_CONSTRUCTOR
         parcel       => "Lucy",
         class_name   => "Lucy::Document::Doc",
         xs_code      => $xs_code,
-        bind_methods => [qw( Set_Doc_ID Get_Doc_ID )],
         make_pod     => {
             methods     => [qw( set_doc_id get_doc_id get_fields )],
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         }
     );
+    $binding->bind_method( method => $_ ) for qw( Set_Doc_ID Get_Doc_ID );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -156,13 +156,13 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Document::HitDoc",
-        bind_methods => [qw( Set_Score Get_Score )],
         xs_code      => $xs_code,
         make_pod     => {
             methods  => [qw( set_score get_score )],
             synopsis => $synopsis,
         },
     );
+    $binding->bind_method( method => $_ ) for qw( Set_Score Get_Score );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Highlight.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Highlight.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Highlight.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Highlight.pm Tue Jan 24 04:15:59 2012
@@ -31,20 +31,18 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Highlight::HeatMap",
-        bind_methods => [
-            qw(
-                Calc_Proximity_Boost
-                Generate_Proximity_Boosts
-                Flatten_Spans
-                Get_Spans
-                )
-        ],
-        bind_constructors => ["new"],
         #make_pod          => {
         #    synopsis    => "    # TODO.\n",
         #    constructor => { sample => $constructor },
         #},
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Calc_Proximity_Boost
+        Generate_Proximity_Boosts
+        Flatten_Spans
+        Get_Spans
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -74,27 +72,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Highlight::Highlighter",
-        bind_methods => [
-            qw(
-                Highlight
-                Encode
-                Create_Excerpt
-                _find_best_fragment|Find_Best_Fragment
-                _raw_excerpt|Raw_Excerpt
-                _highlight_excerpt|Highlight_Excerpt
-                Find_Sentences
-                Set_Pre_Tag
-                Get_Pre_Tag
-                Set_Post_Tag
-                Get_Post_Tag
-                Get_Searcher
-                Get_Query
-                Get_Compiler
-                Get_Excerpt_Length
-                Get_Field
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -116,6 +93,34 @@ END_CONSTRUCTOR
             ]
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Highlight
+        Encode
+        Create_Excerpt
+        Find_Sentences
+        Set_Pre_Tag
+        Get_Pre_Tag
+        Set_Post_Tag
+        Get_Post_Tag
+        Get_Searcher
+        Get_Query
+        Get_Compiler
+        Get_Excerpt_Length
+        Get_Field
+    );
+    $binding->bind_method(
+        alias  => '_find_best_fragment',
+        method => 'Find_Best_Fragment'
+    );
+    $binding->bind_method(
+        alias  => '_raw_excerpt',
+        method => 'Raw_Excerpt'
+    );
+    $binding->bind_method(
+        alias  => '_highlight_excerpt',
+        method => 'Highlight_Excerpt'
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index.pm Tue Jan 24 04:15:59 2012
@@ -79,14 +79,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::BackgroundMerger",
-        bind_methods => [
-            qw(
-                Commit
-                Prepare_Commit
-                Optimize
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             methods => [
                 qw(
@@ -99,6 +91,12 @@ END_CONSTRUCTOR
             constructors => [ { sample => $constructor } ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Commit
+        Prepare_Commit
+        Optimize
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -120,19 +118,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::DataReader",
-        bind_methods => [
-            qw(
-                Get_Schema
-                Get_Folder
-                Get_Segments
-                Get_Snapshot
-                Get_Seg_Tick
-                Get_Segment
-                Aggregator
-                Close
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor, },
@@ -149,6 +134,17 @@ END_CONSTRUCTOR
             ]
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Schema
+        Get_Folder
+        Get_Segments
+        Get_Snapshot
+        Get_Seg_Tick
+        Get_Segment
+        Aggregator
+        Close
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -168,23 +164,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::DataWriter",
-        bind_methods => [
-            qw(
-                Add_Inverted_Doc
-                Add_Segment
-                Delete_Segment
-                Merge_Segment
-                Finish
-                Format
-                Metadata
-                Get_Snapshot
-                Get_Segment
-                Get_PolyReader
-                Get_Schema
-                Get_Folder
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -206,6 +185,21 @@ END_CONSTRUCTOR
             ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Add_Inverted_Doc
+        Add_Segment
+        Delete_Segment
+        Merge_Segment
+        Finish
+        Format
+        Metadata
+        Get_Snapshot
+        Get_Segment
+        Get_PolyReader
+        Get_Schema
+        Get_Folder
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -213,9 +207,9 @@ sub bind_deletionsreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DeletionsReader",
-        bind_constructors => ['new'],
-        bind_methods      => [qw( Iterator Del_Count )],
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Iterator Del_Count );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -223,9 +217,9 @@ sub bind_defaultdeletionsreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DefaultDeletionsReader",
-        bind_constructors => ['new'],
-        bind_methods      => [qw( Read_Deletions )],
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Read_Deletions );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -242,17 +236,6 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::DeletionsWriter",
-        bind_methods => [
-            qw(
-                Generate_Doc_Map
-                Delete_By_Term
-                Delete_By_Query
-                Delete_By_Doc_ID
-                Updated
-                Seg_Deletions
-                Seg_Del_Count
-                )
-        ],
         make_pod => {
             synopsis => $synopsis,
             methods  => [
@@ -265,6 +248,15 @@ END_SYNOPSIS
             ],
         },
     );
+    $binding->bind_method( method => $_ ) for qw(
+        Generate_Doc_Map
+        Delete_By_Term
+        Delete_By_Query
+        Delete_By_Doc_ID
+        Updated
+        Seg_Deletions
+        Seg_Del_Count
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -272,8 +264,8 @@ sub bind_defaultdeletionswriter {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DefaultDeletionsWriter",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -286,13 +278,13 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DocReader",
-        bind_constructors => ["new"],
-        bind_methods      => [qw( Fetch_Doc )],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [qw( fetch_doc aggregator )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Fetch_Doc );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -300,8 +292,8 @@ sub bind_defaultdocreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DefaultDocReader",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -309,8 +301,12 @@ sub bind_docvector {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DocVector",
-        bind_methods      => [qw( Term_Vector Field_Buf Add_Field_Buf )],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Term_Vector
+        Field_Buf
+        Add_Field_Buf
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -319,8 +315,8 @@ sub bind_docwriter {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DocWriter",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -328,9 +324,9 @@ sub bind_filepurger {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::FilePurger",
-        bind_methods      => [qw( Purge )],
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Purge );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -338,8 +334,8 @@ sub bind_highlightreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::HighlightReader",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -347,8 +343,8 @@ sub bind_defaulthighlightreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DefaultHighlightReader",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -356,8 +352,8 @@ sub bind_highlightwriter {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::HighlightWriter",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -392,33 +388,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::IndexManager",
-        bind_constructors => ["new"],
-        bind_methods      => [
-            qw(
-                Recycle
-                Make_Write_Lock
-                Make_Deletion_Lock
-                Make_Merge_Lock
-                Make_Snapshot_Read_Lock
-                Highest_Seg_Num
-                Make_Snapshot_Filename
-                Set_Folder
-                Get_Folder
-                Get_Host
-                Set_Write_Lock_Timeout
-                Get_Write_Lock_Timeout
-                Set_Write_Lock_Interval
-                Get_Write_Lock_Interval
-                Set_Merge_Lock_Timeout
-                Get_Merge_Lock_Timeout
-                Set_Merge_Lock_Interval
-                Get_Merge_Lock_Interval
-                Set_Deletion_Lock_Timeout
-                Get_Deletion_Lock_Timeout
-                Set_Deletion_Lock_Interval
-                Get_Deletion_Lock_Interval
-                )
-        ],
         make_pod => {
             methods => [
                 qw(
@@ -437,6 +406,31 @@ END_CONSTRUCTOR
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Recycle
+        Make_Write_Lock
+        Make_Deletion_Lock
+        Make_Merge_Lock
+        Make_Snapshot_Read_Lock
+        Highest_Seg_Num
+        Make_Snapshot_Filename
+        Set_Folder
+        Get_Folder
+        Get_Host
+        Set_Write_Lock_Timeout
+        Get_Write_Lock_Timeout
+        Set_Write_Lock_Interval
+        Get_Write_Lock_Interval
+        Set_Merge_Lock_Timeout
+        Get_Merge_Lock_Timeout
+        Set_Merge_Lock_Interval
+        Get_Merge_Lock_Interval
+        Set_Deletion_Lock_Timeout
+        Get_Deletion_Lock_Timeout
+        Set_Deletion_Lock_Interval
+        Get_Deletion_Lock_Interval
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -491,18 +485,6 @@ END_CONSTRUCTOR
         parcel       => "Lucy",
         class_name   => "Lucy::Index::IndexReader",
         xs_code      => $xs_code,
-        bind_methods => [
-            qw( Doc_Max
-                Doc_Count
-                Del_Count
-                Fetch
-                Obtain
-                Seg_Readers
-                _offsets|Offsets
-                Get_Components
-                )
-        ],
-        bind_constructors => ['open|do_open'],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => {
@@ -523,6 +505,20 @@ END_CONSTRUCTOR
             ]
         },
     );
+    $binding->bind_constructor(
+        alias       => 'open',
+        initializer => 'do_open',
+    );
+    $binding->bind_method( method => $_ ) for qw(
+        Doc_Max
+        Doc_Count
+        Del_Count
+        Fetch
+        Obtain
+        Seg_Readers
+        Get_Components
+    );
+    $binding->bind_method( alias => '_offsets', method => 'Offsets' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -683,17 +679,6 @@ END_ADD_DOC_POD
         parcel       => "Lucy",
         class_name   => "Lucy::Index::Indexer",
         xs_code      => $xs_code,
-        bind_methods => [
-            qw(
-                Delete_By_Term
-                Delete_By_Query
-                Add_Index
-                Commit
-                Prepare_Commit
-                Optimize
-                )
-        ],
-        bind_constructors => ["_new|init"],
         make_pod          => {
             methods => [
                 { name => 'add_doc', pod => $add_doc_pod },
@@ -710,6 +695,15 @@ END_ADD_DOC_POD
             constructors => [ { pod => $constructor } ],
         },
     );
+    $binding->bind_constructor( alias => '_new' );
+    $binding->bind_method( method => $_ ) for qw(
+        Delete_By_Term
+        Delete_By_Query
+        Add_Index
+        Commit
+        Prepare_Commit
+        Optimize
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -717,21 +711,19 @@ sub bind_inverter {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::Inverter",
-        bind_constructors => ["new"],
-        bind_methods      => [
-            qw(
-                Get_Doc
-                Iterate
-                Next
-                Clear
-                Get_Field_Name
-                Get_Value
-                Get_Type
-                Get_Analyzer
-                Get_Similarity
-                Get_Inversion
-                )
-        ],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Doc
+        Iterate
+        Next
+        Clear
+        Get_Field_Name
+        Get_Value
+        Get_Type
+        Get_Analyzer
+        Get_Similarity
+        Get_Inversion
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -748,13 +740,19 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::Lexicon",
-        bind_methods      => [qw( Seek Next Reset Get_Term Get_Field )],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [qw( seek next get_term reset )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Seek
+        Next
+        Reset
+        Get_Term
+        Get_Field
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -767,13 +765,17 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::LexiconReader",
-        bind_methods      => [qw( Lexicon Doc_Freq Fetch_Term_Info )],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [qw( lexicon doc_freq )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Lexicon
+        Doc_Freq
+        Fetch_Term_Info
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -781,8 +783,8 @@ sub bind_defaultlexiconreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DefaultLexiconReader",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -790,8 +792,8 @@ sub bind_lexiconwriter {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::LexiconWriter",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -799,8 +801,8 @@ sub bind_polylexicon {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::PolyLexicon",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -832,11 +834,12 @@ END_XS_CODE
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::PolyReader",
-        bind_constructors => [ 'new', 'open|do_open' ],
-        bind_methods      => [qw( Get_Seg_Readers )],
         make_pod          => { synopsis => $synopsis },
         xs_code           => $xs_code,
     );
+    $binding->bind_constructor;
+    $binding->bind_constructor( alias => 'open', initializer => 'do_open' );
+    $binding->bind_method( method => $_ ) for qw( Get_Seg_Readers );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -844,11 +847,11 @@ sub bind_posting {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::Posting",
-        bind_methods => [qw( Get_Doc_ID )],
         #    make_pod => {
         #        synopsis => "    # Abstract base class.\n",
         #    },
     );
+    $binding->bind_method( method => $_ ) for qw( Get_Doc_ID );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -868,15 +871,6 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::PostingList",
-        bind_methods => [
-            qw(
-                Seek
-                Get_Posting
-                Get_Doc_Freq
-                Make_Matcher
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [
@@ -890,6 +884,13 @@ END_SYNOPSIS
             ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Seek
+        Get_Posting
+        Get_Doc_Freq
+        Make_Matcher
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -906,13 +907,16 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::PostingListReader",
-        bind_constructors => ["new"],
-        bind_methods      => [qw( Posting_List Get_Lex_Reader )],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [qw( posting_list )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Posting_List
+        Get_Lex_Reader
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -920,8 +924,8 @@ sub bind_defaultpostinglistreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DefaultPostingListReader",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -940,8 +944,8 @@ END_XS
         parcel            => "Lucy",
         class_name        => "Lucy::Index::PostingListWriter",
         xs_code           => $xs_code,
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -949,8 +953,11 @@ sub bind_seglexicon {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::SegLexicon",
-        bind_methods      => [qw( Get_Term_Info Get_Field_Num )],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Term_Info
+        Get_Field_Num
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -959,9 +966,9 @@ sub bind_segpostinglist {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::SegPostingList",
-        bind_methods      => [qw( Get_Post_Stream Get_Count )],
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Post_Stream Get_Count );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -986,13 +993,17 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::SegReader",
-        bind_methods      => [qw( Get_Seg_Name Get_Seg_Num Register )],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [qw( Get_Seg_Name Get_Seg_Num )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Seg_Name
+        Get_Seg_Num
+        Register
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1000,14 +1011,6 @@ sub bind_segwriter {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::SegWriter",
-        bind_constructors => ["new"],
-        bind_methods      => [
-            qw(
-                Add_Writer
-                Register
-                Fetch
-                )
-        ],
         make_pod => {
             methods => [
                 qw(
@@ -1019,6 +1022,12 @@ sub bind_segwriter {
             ],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Add_Writer
+        Register
+        Fetch
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1058,22 +1067,6 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::Segment",
-        bind_methods => [
-            qw(
-                Add_Field
-                _store_metadata|Store_Metadata
-                Fetch_Metadata
-                Field_Num
-                Field_Name
-                Get_Name
-                Get_Number
-                Set_Count
-                Get_Count
-                Write_File
-                Read_File
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [
@@ -1091,6 +1084,23 @@ END_SYNOPSIS
             ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Add_Field
+        Fetch_Metadata
+        Field_Num
+        Field_Name
+        Get_Name
+        Get_Number
+        Set_Count
+        Get_Count
+        Write_File
+        Read_File
+    );
+    $binding->bind_method(
+        alias  => '_store_metadata',
+        method => 'Store_Metadata',
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1124,22 +1134,22 @@ END_SYNOPSIS
         parcel       => "Lucy",
         class_name   => "Lucy::Index::Similarity",
         xs_code      => $xs_code,
-        bind_methods => [
-            qw( IDF
-                TF
-                Encode_Norm
-                Decode_Norm
-                Query_Norm
-                Length_Norm
-                Coord )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
             methods     => [qw( length_norm )],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        IDF
+        TF
+        Encode_Norm
+        Decode_Norm
+        Query_Norm
+        Length_Norm
+        Coord
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1158,19 +1168,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::Snapshot",
-        bind_methods => [
-            qw(
-                List
-                Num_Entries
-                Add_Entry
-                Delete_Entry
-                Read_File
-                Write_File
-                Set_Path
-                Get_Path
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -1188,6 +1185,17 @@ END_CONSTRUCTOR
             ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        List
+        Num_Entries
+        Add_Entry
+        Delete_Entry
+        Read_File
+        Write_File
+        Set_Path
+        Get_Path
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1223,8 +1231,8 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Index::SortCache",
         xs_code      => $xs_code,
-        bind_methods => [qw( Ordinal Find )],
     );
+    $binding->bind_method( method => $_ ) for qw( Ordinal Find );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1232,9 +1240,9 @@ sub bind_sortreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::SortReader",
-        bind_constructors => ["new"],
-        bind_methods      => [qw( Fetch_Sort_Cache )],
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Fetch_Sort_Cache );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1242,8 +1250,8 @@ sub bind_defaultsortreader {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::DefaultSortReader",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1262,8 +1270,8 @@ END_XS
         parcel            => "Lucy",
         class_name        => "Lucy::Index::SortWriter",
         xs_code           => $xs_code,
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -1271,20 +1279,18 @@ sub bind_terminfo {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Index::TermInfo",
-        bind_methods => [
-            qw(
-                Get_Doc_Freq
-                Get_Lex_FilePos
-                Get_Post_FilePos
-                Get_Skip_FilePos
-                Set_Doc_Freq
-                Set_Lex_FilePos
-                Set_Post_FilePos
-                Set_Skip_FilePos
-                Reset
-                )
-        ],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Doc_Freq
+        Get_Lex_FilePos
+        Get_Post_FilePos
+        Get_Skip_FilePos
+        Set_Doc_Freq
+        Set_Lex_FilePos
+        Set_Post_FilePos
+        Set_Skip_FilePos
+        Reset
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -1293,14 +1299,12 @@ sub bind_termvector {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::TermVector",
-        bind_constructors => ["new"],
-        bind_methods      => [
-            qw(
-                Get_Positions
-                Get_Start_Offsets
-                Get_End_Offsets
-                )
-        ],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Positions
+        Get_Start_Offsets
+        Get_End_Offsets
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index/Posting.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index/Posting.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index/Posting.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Index/Posting.pm Tue Jan 24 04:15:59 2012
@@ -35,12 +35,12 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::Posting::MatchPosting",
-        bind_constructors => ["new"],
-        bind_methods      => [qw( Get_Freq )],
         #    make_pod => {
         #        synopsis => $synopsis,
         #    }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Freq );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -58,11 +58,11 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Index::Posting::RichPosting",
-        bind_constructors => ["new"],
         #    make_pod => {
         #        synopsis => $synopsis,
         #    }
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -104,11 +104,11 @@ END_SYNOPSIS
         parcel            => "Lucy",
         class_name        => "Lucy::Index::Posting::ScorePosting",
         xs_code           => $xs_code,
-        bind_constructors => ["new"],
         #    make_pod => {
         #        synopsis => $synopsis,
         #    }
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Lucy.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Lucy.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Lucy.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Lucy.pm Tue Jan 24 04:15:59 2012
@@ -313,8 +313,8 @@ sub bind_testschema {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Test::TestSchema",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Object.pm Tue Jan 24 04:15:59 2012
@@ -49,25 +49,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Object::BitVector",
-        bind_methods => [
-            qw( Get
-                Set
-                Clear
-                Clear_All
-                And
-                Or
-                And_Not
-                Xor
-                Flip
-                Flip_Block
-                Next_Hit
-                To_Array
-                Grow
-                Count
-                Get_Capacity
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -90,6 +71,24 @@ END_CONSTRUCTOR
             ],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get
+        Set
+        Clear
+        Clear_All
+        And
+        Or
+        And_Not
+        Xor
+        Flip
+        Flip_Block
+        Next_Hit
+        To_Array
+        Grow
+        Count
+        Get_Capacity
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -126,13 +125,11 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Object::ByteBuf",
         xs_code      => $xs_code,
-        bind_methods => [
-            qw(
-                Get_Size
-                Get_Capacity
-                Cat
-                )
-        ],
+    );
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Size
+        Get_Capacity
+        Cat
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -227,10 +224,10 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Object::Err",
-        bind_methods      => [qw( Cat_Mess Get_Mess )],
         make_pod          => { synopsis => $synopsis },
-        bind_constructors => ["_new"],
     );
+    $binding->bind_constructor( alias => '_new' );
+    $binding->bind_method( method => $_ ) for qw( Cat_Mess Get_Mess );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -292,19 +289,17 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Object::Hash",
         xs_code      => $xs_code,
-        bind_methods => [
-            qw(
-                Fetch
-                Delete
-                Keys
-                Values
-                Find_Key
-                Clear
-                Iterate
-                Get_Size
-                )
-        ],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Fetch
+        Delete
+        Keys
+        Values
+        Find_Key
+        Clear
+        Iterate
+        Get_Size
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -466,8 +461,8 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Object::I32Array",
         xs_code      => $xs_code,
-        bind_methods => [qw( Get Get_Size )],
     );
+    $binding->bind_method( method => $_ ) for qw( Get Get_Size );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -475,9 +470,9 @@ sub bind_lockfreeregistry {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Object::LockFreeRegistry",
-        bind_methods      => [qw( Register Fetch )],
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Register Fetch );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -502,8 +497,8 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Object::Float32",
         xs_code      => $float32_xs_code,
-        bind_methods => [qw( Set_Value Get_Value )],
     );
+    $binding->bind_method( method => $_ ) for qw( Set_Value Get_Value );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -528,8 +523,8 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Object::Float64",
         xs_code      => $float64_xs_code,
-        bind_methods => [qw( Set_Value Get_Value )],
     );
+    $binding->bind_method( method => $_ ) for qw( Set_Value Get_Value );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -709,27 +704,6 @@ END_DESCRIPTION
         parcel       => "Lucy",
         class_name   => "Lucy::Object::Obj",
         xs_code      => $xs_code,
-        bind_methods => [
-            qw(
-                Get_RefCount
-                Inc_RefCount
-                Dec_RefCount
-                Get_VTable
-                To_String
-                To_I64
-                To_F64
-                Dump
-                _load|Load
-                Clone
-                Mimic
-                Equals
-                Hash_Sum
-                Serialize
-                Deserialize
-                Destroy
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             description => $description,
@@ -745,6 +719,25 @@ END_DESCRIPTION
             ],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_RefCount
+        Inc_RefCount
+        Dec_RefCount
+        Get_VTable
+        To_String
+        To_I64
+        To_F64
+        Dump
+        Clone
+        Mimic
+        Equals
+        Hash_Sum
+        Serialize
+        Deserialize
+        Destroy
+    );
+    $binding->bind_method( alias => '_load', method => 'Load' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -821,17 +814,15 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Object::VArray",
         xs_code      => $xs_code,
-        bind_methods => [
-            qw(
-                Push
-                Push_VArray
-                Unshift
-                Excise
-                Resize
-                Get_Size
-                )
-        ],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Push
+        Push_VArray
+        Unshift
+        Excise
+        Resize
+        Get_Size
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -886,8 +877,8 @@ END_XS_CODE
         parcel       => "Lucy",
         class_name   => "Lucy::Object::VTable",
         xs_code      => $xs_code,
-        bind_methods => [qw( Get_Name Get_Parent )],
     );
+    $binding->bind_method( method => $_ ) for qw( Get_Name Get_Parent );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Plan.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Plan.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Plan.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Plan.pm Tue Jan 24 04:15:59 2012
@@ -81,26 +81,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Plan::Architecture",
-        bind_methods => [
-            qw(
-                Index_Interval
-                Skip_Interval
-                Init_Seg_Reader
-                Register_Doc_Writer
-                Register_Doc_Reader
-                Register_Deletions_Writer
-                Register_Deletions_Reader
-                Register_Lexicon_Reader
-                Register_Posting_List_Writer
-                Register_Posting_List_Reader
-                Register_Sort_Writer
-                Register_Sort_Reader
-                Register_Highlight_Writer
-                Register_Highlight_Reader
-                Make_Similarity
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [
@@ -112,6 +92,24 @@ END_CONSTRUCTOR
             constructors => [ { sample => $constructor } ],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Index_Interval
+        Skip_Interval
+        Init_Seg_Reader
+        Register_Doc_Writer
+        Register_Doc_Reader
+        Register_Deletions_Writer
+        Register_Deletions_Reader
+        Register_Lexicon_Reader
+        Register_Posting_List_Writer
+        Register_Posting_List_Reader
+        Register_Sort_Writer
+        Register_Sort_Reader
+        Register_Highlight_Writer
+        Register_Highlight_Reader
+        Make_Similarity
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -132,12 +130,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Plan::BlobType",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -156,17 +154,6 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Plan::FieldType",
-        bind_methods => [
-            qw(
-                Get_Boost
-                Indexed
-                Stored
-                Sortable
-                Binary
-                Compare_Values
-                )
-        ],
-        bind_constructors => ["new|init2"],
         make_pod          => {
             synopsis => $synopis,
             methods  => [
@@ -180,6 +167,15 @@ END_SYNOPSIS
             ],
         }
     );
+    $binding->bind_constructor( alias => 'new', initializer => 'init2' );
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Boost
+        Indexed
+        Stored
+        Sortable
+        Binary
+        Compare_Values
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -200,12 +196,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Plan::Float32Type",
-        bind_constructors => ["new|init2"],
         #make_pod          => {
         #    synopsis    => $synopsis,
         #    constructor => { sample => $constructor },
         #},
     );
+    $binding->bind_constructor( alias => 'new', initializer => 'init2' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -226,12 +222,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Plan::Float64Type",
-        bind_constructors => ["new|init2"],
         #make_pod          => {
         #    synopsis    => $synopsis,
         #    constructor => { sample => $constructor },
         #},
     );
+    $binding->bind_constructor( alias => 'new', initializer => 'init2' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -262,13 +258,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Plan::FullTextType",
-        bind_constructors => ["new|init2"],
-        bind_methods      => [
-            qw(
-                Set_Highlightable
-                Highlightable
-                )
-        ],
         make_pod => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -280,6 +269,11 @@ END_CONSTRUCTOR
             ],
         },
     );
+    $binding->bind_constructor( alias => 'new', initializer => 'init2' );
+    $binding->bind_method( method => $_ ) for qw(
+        Set_Highlightable
+        Highlightable
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -300,12 +294,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Plan::Int32Type",
-        bind_constructors => ["new|init2"],
         #make_pod          => {
         #    synopsis    => $synopsis,
         #    constructor => { sample => $constructor },
         #},
     );
+    $binding->bind_constructor( alias => 'new', initializer => 'init2' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -326,12 +320,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Plan::Int64Type",
-        bind_constructors => ["new|init2"],
         #make_pod          => {
         #    synopsis    => $synopsis,
         #    constructor => { sample => $constructor },
         #},
     );
+    $binding->bind_constructor( alias => 'new', initializer => 'init2' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -359,22 +353,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Plan::Schema",
-        bind_methods => [
-            qw(
-                Architecture
-                Get_Architecture
-                Get_Similarity
-                Fetch_Type
-                Fetch_Analyzer
-                Fetch_Sim
-                Num_Fields
-                All_Fields
-                Spec_Field
-                Write
-                Eat
-                )
-        ],
-        bind_constructors => [qw( new )],
         make_pod          => {
             methods => [
                 qw(
@@ -392,6 +370,20 @@ END_CONSTRUCTOR
             constructors => [ { sample => $constructor } ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Architecture
+        Get_Architecture
+        Get_Similarity
+        Fetch_Type
+        Fetch_Analyzer
+        Fetch_Sim
+        Num_Fields
+        All_Fields
+        Spec_Field
+        Write
+        Eat
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -414,12 +406,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Plan::StringType",
-        bind_constructors => ["new|init2"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor( alias => 'new', initializer => 'init2' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search.pm Tue Jan 24 04:15:59 2012
@@ -56,8 +56,8 @@ sub bind_andmatcher {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::ANDMatcher",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -79,13 +79,13 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::ANDQuery",
-        bind_constructors => ["new"],
         make_pod          => {
             methods     => [qw( add_child )],
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -93,8 +93,8 @@ sub bind_bitvecmatcher {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::BitVecMatcher",
-        bind_constructors => [qw( new )],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -114,22 +114,20 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::Collector",
-        bind_methods => [
-            qw(
-                Collect
-                Set_Reader
-                Set_Base
-                Set_Matcher
-                Need_Score
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => "    # Abstract base class.\n",
             constructor => { sample => $constructor },
             methods     => [qw( collect )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Collect
+        Set_Reader
+        Set_Base
+        Set_Matcher
+        Need_Score
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -137,8 +135,8 @@ sub bind_offsetcollector {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::Collector::OffsetCollector",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -166,19 +164,6 @@ END_CONSTRUCTOR_CODE_SAMPLE
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::Compiler",
-        bind_methods => [
-            qw(
-                Make_Matcher
-                Get_Parent
-                Get_Similarity
-                Get_Weight
-                Sum_Of_Squared_Weights
-                Apply_Norm_Factor
-                Normalize
-                Highlight_Spans
-                )
-        ],
-        bind_constructors => ["do_new"],
         make_pod          => {
             methods => [
                 qw(
@@ -196,6 +181,17 @@ END_CONSTRUCTOR_CODE_SAMPLE
             constructor => { sample => $constructor },
         }
     );
+    $binding->bind_constructor( alias => 'do_new' );
+    $binding->bind_method( method => $_ ) for qw(
+        Make_Matcher
+        Get_Parent
+        Get_Similarity
+        Get_Weight
+        Sum_Of_Squared_Weights
+        Apply_Norm_Factor
+        Normalize
+        Highlight_Spans
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -203,8 +199,8 @@ sub bind_hitqueue {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::HitQueue",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -223,18 +219,13 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::Hits",
-        bind_methods => [
-            qw(
-                Total_Hits
-                Next
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis => $synopsis,
             methods  => [qw( next total_hits )],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Total_Hits Next );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -259,8 +250,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::IndexSearcher",
-        bind_methods      => [qw( Get_Reader )],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -275,6 +264,8 @@ END_CONSTRUCTOR
             ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Reader );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -307,14 +298,14 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::LeafQuery",
-        bind_methods      => [qw( Get_Field Get_Text )],
-        bind_constructors => ["new"],
         make_pod          => {
             methods     => [qw( get_field get_text )],
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Field Get_Text );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -326,9 +317,9 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::MatchAllQuery",
-        bind_constructors => ["new"],
         make_pod          => { constructor => { sample => $constructor }, }
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -336,17 +327,15 @@ sub bind_matchdoc {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::MatchDoc",
-        bind_methods => [
-            qw(
-                Get_Doc_ID
-                Set_Doc_ID
-                Get_Score
-                Set_Score
-                Get_Values
-                Set_Values
-                )
-        ],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Doc_ID
+        Set_Doc_ID
+        Get_Score
+        Set_Score
+        Get_Values
+        Set_Values
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
@@ -363,14 +352,20 @@ END_CONSTRUCTOR_CODE_SAMPLE
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::Matcher",
-        bind_methods      => [qw( Next Advance Get_Doc_ID Score Collect )],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
             methods     => [qw( next advance get_doc_id score )],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Next
+        Advance
+        Get_Doc_ID
+        Score
+        Collect
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -378,8 +373,8 @@ sub bind_notmatcher {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::NOTMatcher",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -404,14 +399,17 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::NOTQuery",
-        bind_constructors => ["new"],
-        bind_methods      => [qw( Get_Negated_Query Set_Negated_Query )],
         make_pod          => {
             methods     => [qw( get_negated_query set_negated_query )],
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Negated_Query
+        Set_Negated_Query
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -423,9 +421,9 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::NoMatchQuery",
-        bind_constructors => ["new"],
         make_pod          => { constructor => { sample => $constructor }, }
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -447,13 +445,13 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::ORQuery",
-        bind_constructors => ["new"],
         make_pod          => {
             methods     => [qw( add_child )],
             synopsis    => $synopsis,
             constructor => { sample => $constructor, }
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -461,8 +459,8 @@ sub bind_orscorer {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::ORScorer",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -478,14 +476,14 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::PhraseQuery",
-        bind_methods      => [qw( Get_Field Get_Terms )],
-        bind_constructors => ["new"],
         make_pod          => {
             constructor => { sample => '' },
             synopsis    => $synopsis,
             methods     => [qw( get_field get_terms )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Field Get_Terms );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -493,8 +491,8 @@ sub bind_phrasecompiler {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::PhraseCompiler",
-        bind_constructors => ["do_new"],
     );
+    $binding->bind_constructor( alias => 'do_new' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -517,10 +515,14 @@ END_SYNOPSIS
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::PolyQuery",
-        bind_methods      => [qw( Add_Child Set_Children Get_Children )],
-        bind_constructors => ["new"],
         make_pod          => { synopsis => $synopsis, },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Add_Child
+        Set_Children
+        Get_Children
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -547,7 +549,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::PolySearcher",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -561,6 +562,7 @@ END_CONSTRUCTOR
             ],
         }
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -592,18 +594,18 @@ END_CONSTRUCTOR_CODE_SAMPLE
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::Query",
-        bind_methods => [
-            qw( Set_Boost
-                Get_Boost
-                _make_compiler|Make_Compiler )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
             methods     => [qw( make_compiler set_boost get_boost )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Set_Boost Get_Boost );
+    $binding->bind_method(
+        alias  => '_make_compiler',
+        method => 'Make_Compiler',
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -629,27 +631,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::QueryParser",
-        bind_methods => [
-            qw(
-                Parse
-                Tree
-                Expand
-                Expand_Leaf
-                Prune
-                Heed_Colons
-                Set_Heed_Colons
-                Get_Analyzer
-                Get_Schema
-                Get_Fields
-                Make_Term_Query
-                Make_Phrase_Query
-                Make_AND_Query
-                Make_OR_Query
-                Make_NOT_Query
-                Make_Req_Opt_Query
-                )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             methods => [
                 qw( parse
@@ -670,6 +651,25 @@ END_CONSTRUCTOR
             constructor => { sample => $constructor },
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Parse
+        Tree
+        Expand
+        Expand_Leaf
+        Prune
+        Heed_Colons
+        Set_Heed_Colons
+        Get_Analyzer
+        Get_Schema
+        Get_Fields
+        Make_Term_Query
+        Make_Phrase_Query
+        Make_AND_Query
+        Make_OR_Query
+        Make_NOT_Query
+        Make_Req_Opt_Query
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -705,12 +705,12 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::RangeQuery",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -718,8 +718,8 @@ sub bind_requiredoptionalmatcher {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::RequiredOptionalMatcher",
-        bind_constructors => ["new"],
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -743,11 +743,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::RequiredOptionalQuery",
-        bind_methods => [
-            qw( Get_Required_Query Set_Required_Query
-                Get_Optional_Query Set_Optional_Query )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             methods => [
                 qw( get_required_query set_required_query
@@ -757,6 +752,13 @@ END_CONSTRUCTOR
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Required_Query
+        Set_Required_Query
+        Get_Optional_Query
+        Set_Optional_Query
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -774,19 +776,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::Searcher",
-        bind_methods => [
-            qw( Doc_Max
-                Doc_Freq
-                Glean_Query
-                Hits
-                Collect
-                Top_Docs
-                Fetch_Doc
-                Fetch_Doc_Vec
-                Get_Schema
-                Close )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => "    # Abstract base class.\n",
             constructor => { sample => $constructor },
@@ -803,6 +792,19 @@ END_CONSTRUCTOR
             ],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Doc_Max
+        Doc_Freq
+        Glean_Query
+        Hits
+        Collect
+        Top_Docs
+        Fetch_Doc
+        Fetch_Doc_Vec
+        Get_Schema
+        Close
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -852,14 +854,14 @@ END_CONSTRUCTOR
         parcel            => "Lucy",
         class_name        => "Lucy::Search::SortRule",
         xs_code           => $xs_code,
-        bind_constructors => ["_new"],
-        bind_methods      => [qw( Get_Field Get_Reverse )],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
             methods     => [qw( get_field get_reverse )],
         },
     );
+    $binding->bind_constructor( alias => '_new' );
+    $binding->bind_method( method => $_ ) for qw( Get_Field Get_Reverse );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -884,13 +886,13 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::SortSpec",
-        bind_methods      => [qw( Get_Rules )],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Rules );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -916,15 +918,6 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::Span",
-        bind_methods => [
-            qw( Set_Offset
-                Get_Offset
-                Set_Length
-                Get_Length
-                Set_Weight
-                Get_Weight )
-        ],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
@@ -938,6 +931,15 @@ END_CONSTRUCTOR
             ],
         }
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Set_Offset
+        Get_Offset
+        Set_Length
+        Get_Length
+        Set_Weight
+        Get_Weight
+    );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -960,14 +962,14 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::TermQuery",
-        bind_methods      => [qw( Get_Field Get_Term )],
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
             methods     => [qw( get_field get_term )],
         },
     );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw( Get_Field Get_Term );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -975,8 +977,8 @@ sub bind_termcompiler {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::TermCompiler",
-        bind_constructors => ["do_new"],
     );
+    $binding->bind_constructor( alias => 'do_new' );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -984,14 +986,12 @@ sub bind_topdocs {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel       => "Lucy",
         class_name   => "Lucy::Search::TopDocs",
-        bind_methods => [
-            qw(
-                Get_Match_Docs
-                Get_Total_Hits
-                Set_Total_Hits
-                )
-        ],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Get_Match_Docs
+        Get_Total_Hits
+        Set_Total_Hits
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search/Collector.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search/Collector.pm?rev=1235130&r1=1235129&r2=1235130&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search/Collector.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build/Binding/Search/Collector.pm Tue Jan 24 04:15:59 2012
@@ -43,13 +43,13 @@ END_CONSTRUCTOR
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::Collector::BitCollector",
-        bind_constructors => ["new"],
         make_pod          => {
             synopsis    => $synopsis,
             constructor => { sample => $constructor },
             methods     => [qw( collect )],
         },
     );
+    $binding->bind_constructor;
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 
@@ -57,8 +57,11 @@ sub bind_sortcollector {
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel            => "Lucy",
         class_name        => "Lucy::Search::Collector::SortCollector",
-        bind_methods      => [qw( Pop_Match_Docs Get_Total_Hits )],
-        bind_constructors => ["new"],
+    );
+    $binding->bind_constructor;
+    $binding->bind_method( method => $_ ) for qw(
+        Pop_Match_Docs
+        Get_Total_Hits
     );
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }