Larry Wall wrote:
> A multi sub presents only an MMD interface, while a multi method presents
> both MMD and SMD interfaces.  In this case, there's not much point in the
> SMD inteface since .. used as infix is always going to call the MMD interface.

  multi method : MMD and SMD
  multi sub: MMD only
  method: SMD only
  sub: no dispatching

And just so that it's clear: when you talk about the SMD interface,
you're talking about being able to say "$" instead of "foo
$var", right?  Whereas MMD doesn't have any special calling syntax. 
Otherwise, the only difference between MMD and SMD would be the number
of arguments that are used for dispatching purposes (all of them vs.
just the first one).

Can subs be declared within classes?  Can methods be declared without
classes?  If the answers to both of these questions are "no", then it
occurs to me that you _could_ unify the two under a single name, using
the class boundary as the distinguishing factor (e.g., a method is
merely a sub declared within a class).  If the answer to either is
"yes", I'd be curious to know how it would work.

Jonathan "Dataweaver" Lang

Reply via email to