On Saturday 22 December 2001 02:29 am, Brent Dax wrote:
> I've been thinking about improvements that could be made to Exporter for
> Perl 6.
>
>       1. Choosing where to export to:
>               use Data::Dumper 'Dumper' => 'dumpvar';
>               #exports Data::Dumper::Dumper to Main::dumpvar (or whatever)

Where to import to.  It's probably not a good idea to export into someone 
else's namespace.  (Pull vs Push).

>       2. Built-in switch handling:
>               use Data::Dumper ('Dumper' : qw(+Indent=2 +Useqq));
>               #imports Dumper, sets $Data::Dumper::Indent=2, and
>               # does $Data::Dumper::Useqq is true

Is it more or less confusing (overall) to be mixing importation with simple, 
non-imported data initialization, as opposed to having it all be imported 
(with optional data initialization)?  

>       3. Warnings about conflicts:
>               use warnings 'Exporter';
>               sub Dumper { ... }
>               use Data::Dumper qw(Dumper);
>               #prints out a warning (not just 'redefined subroutine', either).
>       4. For modules, saying 'use Exporter' should be enough to get import.
>          If you don't want Exporter's import(), just C<use Exporter()>.
>       5. In addition to @EXPORT/@EXPORT_OK/%EXPORT_TAGS, provide a way to do
>          it on the 'use Exporter' line.
>
> So, with those requirements and what knowledge of Perl 6 I have, I
> present a preliminary Exporter.  I typed it directly into the mailer, so
> there's a good chance of mistakes.  If anyone spots any mistakes in it,
> let me know.

Well, I can't get it to run....  :-)

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to