I haven't (and won't) have time to go into this in detail :-(
I feel that this proposal is solving the wrong problem. The issue is
that the original Forest and Frog (or DBI and DBI::st) classes are not
*designed* for user-definable Frogs (DBI::st's). If that functionality
is widely needed, the Forest should be redesigned with *configurable*
Frogs.
But even if you can't redesign the forest, Perl still makes it easy to
impose a Japanese accent on Frogs wherever you need to:
my $forest = Forest->new();
if (can_see_Mt_Fuji()) {
local *Frog::speak = sub { "kerokero" };
# or:
# local *Frog::speak = \&Frog::Japanese::speak;
print $forest->make_noise(); # "kerokero"
}
print $forest->make_noise(); # "ribbit-ribbit"
Damian
- RFC 254 (v1) Class Collections: Provide the ability to... Perl6 RFC Librarian
- Re: RFC 254 (v1) Class Collections: Provide the a... Michael G Schwern
- Re: RFC 254 (v1) Class Collections: Provide t... Nathan Wiger
- Re: RFC 254 (v1) Class Collections: Provi... Greg Williams
- Re: RFC 254 (v1) Class Collections: Provi... Damian Conway
- Re: RFC 254 (v1) Class Collections: P... Greg Williams
- Re: RFC 254 (v1) Class Collections: P... Damian Conway
- Re: RFC 254 (v1) Class Collections: Provide t... Greg Williams
- Re: RFC 254 (v1) Class Collections: Provi... David L. Nicol
- Re: RFC 254 (v1) Class Collections: P... Mark Summerfield
- Re: RFC 254 (v1) Class Collections: P... Greg Williams
- Re: RFC 254 (v1) Class Collectio... David L. Nicol
