in reply to Module Design strawman - Exporter::VA

Don't repeat some of Exporter's mistakes. Default exports and export tags are not generally a good idea. Users often do not want your names for your functions and should be able to rename them in the import. There is a lot of parsing work figuring out how to export variables. Don't do that multiple times. Don't force people to inherit.

Just do variables and functions in the first pass. Figure out a syntax that allows users to rename variables. Have the module author calls a function and it builds an import for you.

Worry about enhancements later.

  • Comment on Re: Module Design strawman - Exporter::VA

Replies are listed 'Best First'.
Re: Re: Module Design strawman - Exporter::VA
by John M. Dlugosz (Monsignor) on Oct 07, 2002 at 15:23 UTC
    There is a lot of parsing work figuring out how to export variables. Don't do that multiple times.

    What do you mean?

    Users often do not want your names for your functions and should be able to rename them in the import.

    How often? I figured if you don't want that name, don't import it! Renaming on import would create apparently different interfaces to the same module, and make it harder to understand. I've never seen this discussed as a problem. Can you go into it more?

    Certainly, I could do it with a array ref in the import list:  use MyModule v2.03 ('foo', [bar => 'renamed_bar'], 'baz');

    Don't force people to inherit.

    I suppose importing import from Exporter::VA would accomplish the same thing as inheriting from it. What is the disadvantage of inheriting from it?

    —John