[KinoSearch] Re: Subclassable Highlighter
Father Chrysostomos
sprout at cpan.org
Fri Feb 29 11:29:26 PST 2008
On Feb 26, 2008, at 9:36 PM, Marvin Humphrey wrote:
> How about if we change highlight() to use variables which are
> settable via accessors?
>
> __PACKAGE__->ready_get_set(qw( pre_tag post_tag ));
>
> sub highlight { "$pre_tag{$$self}$_[1]$post_tag{$$self}" }
This sounds fine. I’m working on a patch.
> I'd really like to kill off those four classes.
Does it have to be all four? We could keep Encoder, and have
Highlighter accept a code ref, as well as an Encoder object. If
Highlighter is ever ported to C, then XS code could wrap a code ref in
an Encoder subclass.
More information about the kinosearch
mailing list