On 8/10/05, Autrijus Tang <[EMAIL PROTECTED]> wrote:
> But it's an toplevel optimization, which is not applicable to
> module authors.  So I'd very much welcome a lexical pragma that
> forces static binding of subroutine calls.

Yeah, but the whole point of not allowing that is so that you can
override modules when you need to.  However, I think the toplevel
closed requirement might be a little too harsh.  After all, you could
just say:

    use dynamic 'Foo';

Or something, to unforce that on a module's behalf.  That declaration
should probably not load the module for you, so that you can force
dynamicity on modules that other modules use.

    use dynamic;

Would force every module to be dynamic, and should probably only be
allowed at the top level.

In summary: You're allowed to say "I don't do funny stuff to myself",
and someone else is allowed to say "but I do funny stuff to you".

The only thing I see as problematic is a module that knows it's evil
and has to "use dynamic". The module could request that the user of
the module "use dynamic", so that people know when they're using a
module that will slow everything down.  The other way is to hack
around it using something like a source filter, pretending that the
user of the module actually did write that.  But that's not $&,
because it's quite a bit more difficult to do. If you encapsulate that
difficulty into a module, that module will eventually be shunned by
the speed-centric part of the community.

Luke

Reply via email to