On Mon, Jun 02, 2003 at 10:34:14AM -0600, Luke Palmer wrote:
> And I don't see what's stopping someone from writing Dispatch::Value.
> 
>     use Dispatch::Value;
>     sub foo($param is value('param1')) {...}
>     sub foo($param is value('param2')) {...}
> 
> What it seems you're wanting is it to be in the core.  

Actually, no.

I expected that there'd be a way to extend runtime behavior through modules
like this hypothetical Dispatch::Value, Dispatch::Multimethods, or
Dispatch::Agent::Smith, but I'm seeing precious little evidence of that,
just allusions to MMD with the 'multi' keyword and all that.

As I said earlier, MMD is starting to give me a big case of The Fear
because it's predicated on offering behavior that heretofore hasn't been
widely used in Perl, and it's based around limitations that don't
necessarily exist in Perl.  It's nice that Perl6 will extend its dynamic
range, but the whole reason for Perl6 in the first place is to fix
some of the warts in the current problem domain.

With some recent focus on MMD (mostly thanks to Dan's WTHI post, and my
discovery of TAMOP), I started to feel like MMD was good for a certain
style of programming, but necessarily ignores a "native" Perl5 idiom that's
equally powerful and perhaps preferable for a large set of problems.

I'm not trying to throw out the type system or cast MMD as pure evil.

Rather, I'm just poking around to make sure the dispatch machinery isn't
wired in for single dispatch/MMD without opening it up for extensions
via simple dispatch classes.  *That* feature seems much more important
to me than wiring in MMD, since MMD could be implemented through
Dispatch::Multimethods or something.  It's been done before with 
Class::Multimethods, and I'll buy that there's a benefit to adding a 
'multi' keyword to the language, but not if that's the last word for
variant dispatching...

If some dispatch class can use some syntax vaguely approximating the straw
man above, then this is just a tempest in a teapot and I'll move along.
But I haven't heard or seen anything concrete that dispatch behavior in
Perl6 can be user-defined without resorting to serious magic.  Instead,
it's starting to sound suspiciously like "you can have any dispatching
behavior you want, so long as it's either single dispatch (modulo
sub/method semantics) or MMD".  And that would be a net loss for Perl6.

Z.

Reply via email to