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

Re: Pre-RFC: no feature 'filetests';

Thread Previous | Thread Next
From:
Darren Duncan
Date:
October 2, 2021 20:43
Subject:
Re: Pre-RFC: no feature 'filetests';
Message ID:
1a9c81a8-0f0a-7c3c-e619-ef10b89551aa@darrenduncan.net
On 2021-10-02 11:24 a.m., Dan Book wrote:
> On Fri, Oct 1, 2021 at 12:27 PM Dan Book wrote:
>     On Fri, Oct 1, 2021 at 12:24 PM Paul "LeoNerd" Evans wrote:
>         Since it is highly unlikely you'd need to perform filesystem tests
>         during such mathsy code, it would be really handy if the filetest
>         `-x`-like operators were controlled by a (default-on) feature flag,
>         that could be turned off in such code:
> 
>            no feature 'filetests';
> 
>     While I agree with the usefulness for avoiding this parser precedence quirk,
>     I have two issues with this idea: 1) it's a pretty niche use case to warrant
>     a feature flag, 2) this is not a feature we plan to disrecommend in any way,
>     unlike the other reverse features we've recently added, or even format vars
>     which have less tricky alternatives available under use English.
> 
> As mentioned in IRC, I could see this being useful as a standalone pragma, 
> rather than a feature flag - we'd never add or remove this feature flag from 
> versioned feature bundles so it doesn't seem useful to put it there, and it 
> doesn't inherently fit with anything else.

Alternatively I suggest that it may be best for things like this to be 
implemented as CPAN modules rather than in core.

And then where this becomes a core discussion is if implementing features like 
that, namely lexically turning OFF built-in syntax, can't be done in pure Perl 
by a CPAN module or user code, then what are reasaonble more generic changes 
that can be made to the Perl core to make such a generic feature possible.

-- Darren Duncan

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