[EMAIL PROTECTED] wrote:

What about multi subs? They can be defined everywhere. Given:

 multi sub *foo(A $a, B $b) {...}

Is this something like:

 %globals{"foo"}  -->  MultiSub{"foo_A_B" => Sub, ...}

What about a not so global multi:

 multi sub foo(A $a, B $b) {...}

Thanks for clarifying,
leo



Uh, the real problem is the interaction between multisubs and modules. If you import a multi with the same short name from another module, you get a real issue that needs resolving. Especially if they do fundamentally different things and you don't expect a clash. Like

module Users;
multi get(Stream $f, UserDescriptor $u) {...}

...

module FileTransfer;
multi get(Server $s, File $f) {...}


Even if this is easy to fix by renaming, the error message would take a while to track down and it'd be annoying distraction during development. I believe the DWIM thing to do would be to merge multis into the same MMD object on module load. This would have to happen during runtime, since that's when the module load can occur.


   Miro



Reply via email to