)) {
my $name = join '_', reverse split '_', $type;
my $singular = "${type}er";
- eval qq{sub ${singular} { shift->_ext_rw($name => \@_) }; 1 }
+
+ eval qq{sub ${singular} { shift->${singular}s(\@_) }; 1 }
or die "Method builder failed for ${singular}: $@";
eval qq{sub wrap_${singular} {
- my (\$self, \$key, \$builder) = \@_;
- my \$orig = \$self->_ext_rw('${name}', \$key);
- \$self->_ext_rw(
- '${name}', \$key,
- \$builder->(\$orig, '${name}', \$key)
- );
+ shift->wrap_${singular}s(\@_)
}; 1 } or die "Method builder failed for wrap_${singular}: $@";
+
eval qq{sub ${singular}s {
my (\$self, \@args) = \@_;
while (my (\$this_key, \$this_value) = splice(\@args, 0, 2)) {
eval qq{sub ${singular}_list { sort keys %{\$_[0]->{\$name}} }; 1; }
or die "Method builder failed for ${singular}_list: $@";
}
+ foreach my $singular (qw(unop_expander binop_expander)) {
+ eval qq{sub ${singular} { shift->${singular}s(\@_) }; 1 }
+ or die "Method builder failed for ${singular}: $@";
+ eval qq{sub ${singular}s {
+ my (\$self, \@args) = \@_;
+ while (my (\$this_key, \$this_value) = splice(\@args, 0, 2)) {
+ \$self->_ext_rw(
+ op => \$this_key,
+ \$self->make_${singular}(\$this_value),
+ );
+ }
+ return \$self;
+ }; 1 } or die "Method builder failed for ${singular}s: $@";
+ }
}
sub register_op { $_[0]->{is_op}{$_[1]} = 1; $_[0] }
-=head1 SPECIAL OPERATORS
+=head1 OLD EXTENSION SYSTEM
+
+=head2 SPECIAL OPERATORS
my $sqlmaker = SQL::Abstract->new(special_ops => [
{
]);
-=head1 UNARY OPERATORS
+=head2 UNARY OPERATORS
my $sqlmaker = SQL::Abstract->new(unary_ops => [
{
=back
+=head1 NEW EXTENSION SYSTEM
+
+=head2 expander
+
+=head2 op_expander
+
+=head2
=head1 PERFORMANCE