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

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

Thread Previous | Thread Next
Darren Duncan
October 2, 2021 21:26
Re: Pre-RFC: no feature 'filetests';
Message ID:
On 2021-10-02 1:43 p.m., Darren Duncan wrote:
> 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.

Actually I want to walk back part of what I said, the "in pure Perl" part.

My real point with my second paragraph before was that if a feature like this 
file operator syntax removal can't sufficiently easily be implemented as a CPAN 
module, either with or without XS, then it could be a core discussion about 
removing roadblocks such that the change is sufficiently easy.  Although I 
suspect but don't know that the required core foundation already exists, 
considering the existence of other syntax-modifying CPAN modules.

-- Darren Duncan

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