> Date: Thu, 12 Dec 2002 17:07:21 -0800
> From: Larry Wall <[EMAIL PROTECTED]>
>
> It's not clear what .can should return for a multimethod, either.
> You'd have be able to return results like: "yes int can mult, but
> only if the second argument is an int or num". Basically, .can
> has a bad syntax. We need a modifier on an ordinary multimethod
> or subroutine call that says, "Go through all the motions of calling
> this, but don't really." To do that kind of almost-dispatch you often
> need the actual arguments, or something resembling them. One is tempted
> to say that taking a reference to a function call with arguments
> does something like this:
>
> \&Main::foo(1,3)
>
> The reference could be bound to the dispatch list, or be false if nothing
> matched.
Perhaps currying could be our aide:
can(&foo.assuming(1, 3));
The only question is, what happens when not all the arguments are
curried? Perhaps it could return true if the rest of the arguments
matched any multimethod. So:
can(&bar);
Without any currying would be true if bar is a sub, and false if it
isn't. I think that generalizes nicely.
Luke