I'm still troubled by the export trait as I read S11. I like not having
to write a new subroutine in a procedural module and THEN go back up and
edit @EXPORT. That's good.

But, it seems to me that:

        module MyHTML {
                # Wherein I pretend to have written an HTML module
                # but really just re-brand Perl5ish CGI.pm
                use CGI :html4;
                sub hr(...) is export;
                sub p(...) is export;
                ...
        }

is a lot of work to go through, and it also requires that I correctly
reproduce the prototypes (although if "..." worked as I have it above,
then that would not be a concern).

Can "is export" be applied to use? In other words:

        module MyHTML {
                use CGI :html4 is export;
        }

Also, for those cases where you're writing a very large number of
functions whose only purpose is to pollute the namespace of the caller
(HTML is probably as good an example as any), it would be nice if I
could set up "is export" as the default:

        module MyHTML does allexport {
                sub empty_element(str $n, @tags) is noexport {
                        "<$n {join(" ",@tags)} />"
                }
                sub hr([EMAIL PROTECTED]) { empty_element('hr',@tags) }
                sub br([EMAIL PROTECTED]) { empty_element('br',@tags) }
                ...
        }

I personally don't like this style of programming, but that doesn't mean
it isn't used to good effect by others.
-- 
â 781-324-3772
â [EMAIL PROTECTED]
â http://www.ajs.com/~ajs

Reply via email to