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

Re: Namespaces (was Re: Revisiting trim)

Thread Previous | Thread Next
From:
demerphq
Date:
May 29, 2021 06:54
Subject:
Re: Namespaces (was Re: Revisiting trim)
Message ID:
CANgJU+Vnt3JASc=-iasnV70pJzC=iu=4eYZxuphAXcMdnqRg5w@mail.gmail.com
On Fri, 28 May 2021 at 22:49, Paul "LeoNerd" Evans
<leonerd@leonerd.org.uk> wrote:
>
> Unclear from this discussion whether it was explicitly pointed out, but
> one thing I'd like to see from the "keyword" functions is that they
> *not* appear in the package's symbol table.

Personally I would be opposed to anything that might mean that things
work differently in older perls from newer.

However concern over this point is part of the reason I advocate the
"keyword" api supporting the following:

   use keyword "string::trimmed";
   use keyword "string::trimmed" => "trim";

The first case would ensure that string::trimmed is available to you
via the fully qualified name. The second form would modify your
namespace as normal so that "string::trimmed" is available as "trim".
We can do this in a totally backwards compatible way. Making "trim" be
invisible would be nice, but only if it would also be invisible in
older perls.

cheers
Yves

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