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

Re: Pre-RFC: a `library` keyword

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
April 1, 2022 13:55
Subject:
Re: Pre-RFC: a `library` keyword
Message ID:
aec074b5-ebfa-45b8-a2f3-8d88b2e1d793@beta.fastmail.com
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?

-- 
rjbs
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