On Mon, Jun 09, 2003 at 01:26:22PM +0100, Piers Cawley wrote:


Multimethod dispatch?

   Assuming I'm not misunderstanding what Adam is after, this has come up
   before (I think I asked about value based dispatch a few months back)
   and I can't remember if the decision was that MMD didn't extend to
   dispatching based on value, or if that decision hasn't been taken yet.
   If it's not been taken, I still want to be able to do

      multi factorial (0) { 1 }
      multi factorial ($n) { $n * factorial($n - 1) }

That's a bad example, as it's really not MMD. It's a partially pre-memoized function instead.

Which brings up a issue.  Is it really MMD if you're only dispatching on
a single invocant?  Most of the examples I've seen for MMD so far use
only a single invocant and are really either regular dispatch or simple
overloading instead.  MMD only becomes really interesting if you
have multiple invocants possibly with best-match signature matching
involved.

--
[EMAIL PROTECTED]
[EMAIL PROTECTED]



Reply via email to