develooper Front page | perl.perl5.porters | Postings from March 2022

Re: Pre-RFC: a `module` keyword

Thread Previous | Thread Next
From:
Ovid via perl5-porters
Date:
March 23, 2022 09:11
Subject:
Re: Pre-RFC: a `module` keyword
Message ID:
1690625351.1072140.1648026686397@mail.yahoo.com
On Friday, 11 February 2022, 10:52:36 CET, Neil Bowers <neilb@neilb.org> wrote:

> We think there's definitely scope for improving Perl's support for creating modules
> of function libraries, and the import mechanism.

<snip>

> So in its current form, we've marked this as rejected, but we think this is an area
> that's ripe for more thought. Part of that should include a review of CPAN and the
> problems with the current options.

I've been mulling over this for some time because I wanted to have clear thoughts on it and check what's on the CPAN.

I withdraw the `:version` and `:export` parts of this, though I would love to see a lexical export solution. However, the core idea seems solid. Unfortunately, I cannot find anything on the CPAN which solidly supports what I'm looking for. Going with `library` instead of `module` as a keyword:

    library My::Library 0.01 {
        sub foo ($bar) { ... }

        library Pretty { # My::Library::Pretty
            # Public
        }
        library Utils :private { # My::Library::Utils
            # Private to My::Library and enclosed libraries
        }
    }

(I get sick and tired of writing "Utils" packages to organize my code and littering the global namespace)

I could write up more (better keyword suggestions needed), but I simply can't find anything comparable on the CPAN and despite asking around, no one else has offered suggestions. Can anyone offer pointers?
       
Best,
Ovid
-- 
IT consulting, training, specializing in Perl, databases, and agile development
http://www.allaroundtheworld.fr/. 

Buy my book! - http://bit.ly/beginning_perl



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About