On Mon, May 30, 2005 at 08:39:57AM +0000, Luke Palmer wrote:
: Okay, I'd like to set myself straight.  Sanity check:
:     bar($foo, $baz);   # looks for subs (lexical then package), and
: falls back to MMD

Er, no.

:     $foo.bar($baz);    # looks in ref($foo), then falls back to MMD
: If this is correct, can we simplify the latter to mean "MMD only" ? 
: Would there be a more symmetric MMD only form?

bar($foo, $baz) is the MMD form.  However, MMD is defined to pay
attention to lexical scoping, and if the innermost definition of
the sub isn't multi, it reverts to ordinary sub dispatch.  If the
innermost definition is multi, then all multies out to a scope
that is not multi are considered.

Basically, all sub calls are inherently MMD, but ordinary subs are
a degenerate wildcard case that hide any outer definitions.


Reply via email to