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

Re: Pre-RFC: a `library` keyword

Thread Previous | Thread Next
Ricardo Signes
April 1, 2022 13:55
Re: Pre-RFC: a `library` keyword
Message ID:
On Fri, Apr 1, 2022, at 05:22, Ovid via perl5-porters wrote:
>  1. Significantly reduced boilerplate.
>  2. Lexically-scoped effects, not bleeding into the rest of the program
>  3. Private utility modules/functions don't accidentally become part of the public API (!)
>  4. Strict, warnings, utf8 source, signatures, and "no feature 'indirect'" by default (what else?)
>  5. Yields a `1` to avoid needing to add `1` at the end of every file
>  6. As library-based .pm files grow too large, the developer can still move inner libraries to separate .pm files
>  7. Public relations: Perl is still evolving

I think I just don't understand exactly the value proposition here.  I will respond to these by number.

Most of these, I think, are already covered by "use vX" and "package NAME BLOCK".  Specifically, items 1, 2, 4.  You've got "use feature 'library'" so "use vX" is already fewer keystrokes, but who's counting?

Item 3 is addressed by "package NAME BLOCK" already, and by lexical subroutines.  Lexical subroutines are already on by default.

Item 6 is addressed by "package NAME BLOCK", I think?

Item 5 is good.  We should try to eliminate the need for "magic true value" in v5.38, generally.

Item 7 can be made for any "let's add a feature," so isn't particularly interesting, I think.

What have I missed or misunderstood?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About