Dan Sugalski wrote:
> 
> It's the explicit exporting that I'm concerned about. 
> Perhaps I'm being overly worried, but it strikes me that
> if all a module needs to do to get on the autoload list
> is have an @EXPORT_AUTO declaration at the top (or 
> something similar) we're going to see it abused rather badly.

I'm a little confused:
o  Michael Schwern's AnyLoader allows you to autoload modules
   when you explicitly qualify a function from that module.
o  Dan Sugalski is talking about pre-registering certain 'core'
   functions so that their module is loaded if they are called
   _without_ explicity qualifying their package.

I like the idea of making it easier to load and import modules.
o  It is one less thing for the novice perl programmer to think about.
o  If the standard library has conflicting interfaces, i.e. overlapping
   function names... perhaps we could do this in a manner that would
   help us find them and 'fix' them faster
o  If you're worried about abuse, make <C>use strict</C> disallow it
   and <C>no strict 'load'</C> allow it.


Michael Schwern's AnyLoader is a bit strange though. To use an explicitly
qualified function if the only perceivable gain were to allow you to skip
needing an 'use'. After all, if the purpose is to mangle your namespace...
why are you explicitly calling a function in the first place?  But that
isn't the main reason for AnyLoader is it?

Perhaps it makes more sense in the context of things like:
o  Loading OO mods and oddballs like
   > Class::Contract->contract {};
   > $dbh = DBI->connect( ... );
o  Interfaces as in Tim Bunce's suggestion:

Tim Bunce wrote:
>
> Don't forget that it should tie in with the concept of defining
> 'interfaces' so
>
>       use Foo qw(bar);
>
> may actually just load an interface definition and that definition
> can be (lazily) bound to one of several alternative implementations
> of the Foo interface (one XS and one pure-perl, for example).
> 
> Basically I'm saying that transparent autoloading should be an
> attribute of the interface definition.


John Porter wrote:
>
> And it seems strange to suggest it for packages like Foo anyway;
> we already have autoloader.  And that just emphasizes that this
> feature was meant for core functions.

Incorporating something like Michael Schwern's AnyLoader for explicitly
qualified functions would be geared more at the standard and extended
libraries. Dan Sugalski's need to autoload modules from unqualified function
names is a slightly different problem domain. Those function names would be
determined and registered I assume when Perl itself is built / installed /
configured.

Reply via email to