develooper Front page | perl.module-authors | Postings from March 2019

Re: [naming] To pragma or not to pragma?

Thread Previous
From:
Konstantin S. Uvarin
Date:
March 2, 2019 10:14
Subject:
Re: [naming] To pragma or not to pragma?
Message ID:
CAJj2qWm-NOT8oBXkTFTmBU9MnyY0PgoTPSOEW6GsmmZysSpWMg@mail.gmail.com
Hello Dan,

  Ability to be lexical sounds like a terrific rule of thumb. Thank you!

  I changed to Module::Lazy which seems to fall in line with Module::Load
and such.

On Sat, Mar 2, 2019 at 11:02 AM Dan Book <grinnz@gmail.com> wrote:

> On Sat, Mar 2, 2019 at 1:01 AM Konstantin S. Uvarin <khedin@gmail.com>
> wrote:
>
>> Hello,
>>
>>   I'd like to release a module that lazy-loads other modules to reduce
>> startup time.
>>
>>   My initial idea was `lazy` but that was taken, so I switched to
>> `on::demand`. There's also `autouse` with similar functionality.
>>
>>   However, on second thought I'm not even sure if a lowercase name fits
>> in here. It's certainly not as effectful as `namespace::clean` or `strict`.
>>
>>   So the question is, what are the guidelines for deeming a module to be
>> worth called a pragma?
>>
>>
> Strictly speaking, a pragma is usually supposed to affect the lexical
> scope it's imported to, rather than the package. "lib" has precedent of
> doing neither and instead affecting global state, which is more similar to
> your idea. I would say use whichever looks better to you.
>
> -Dan
>


-- 
Konstantin S. Uvarin
jabber: see <from>
skype: kuvarin
http://github.com/dallaylaen

Thread Previous


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