develooper Front page | perl.perl5.porters | Postings from September 2021

Pre-RFC: "builtins" namespace

Thread Next
Paul "LeoNerd" Evans
September 10, 2021 18:47
Pre-RFC: "builtins" namespace
Message ID:
Hi all,

Following up our recent "Namespaces" chat, I'd like to get the ball
rolling on the subject of the builtin functions namespace idea.

I propose to write an RFC to outline the overall mechanism, and give an
*initial* list of functions to include in it. I say initial, because
the entire point of the mechanism is that's where we'll be adding any
of the "simple, acts like a function" things in future, so this very
much doesn't need to be a full complete list; just a few bits and
pieces to get us started.

To that end I am looking for answers to such questions as:

  * What should it be called? Votes on:

      use functions 'abc', 'xyz', ...;
      use function ...;                 # because  function::abc reads

      use builtins ...
      use builtin ...

      use std ...

    This name would have to be well-behaved as a regular CPAN module,
    because the module needs to be dual-life, available to install from
    CPAN so older perls can still use the functions it contains.

    I therefore feel it should be a single toplevel name, and
    all-lowercase. I have no strong thoughts about singular vs. plural
    as a name.

  * What *initial* set of functions to put in it? [again see comment
    above]. So far I'm thinking:

      trimmed($str)   # which started this whole discussion off

      refaddr($ref), reftype($ref), etc... # from Scalar::Util

      getcwd()  # Seriously, because currently we have one in
                  Internals:: of all places, and that really needs to

  * Any other important considerations we've missed

Try to keep comments brief - remember this is a *pre*RFC chat of
"should we write this RFC at all?", rather than fine-tuning inner
details of the idea. That can be handled separately as comments on the
actual RFC as it gets written.

Also try to avoid comments of "please add ${my pet favourite function}"
- as I said this is just an initial list of function names to get the
mechanism itself in place. Once we have something, we can take ideas on
more functions on a case-by-case basis.

Paul "LeoNerd" Evans      |  |

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