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

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

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
October 2, 2021 21:30
Subject:
Re: Pre-RFC: no feature 'filetests';
Message ID:
20211002223036.15148609@shy.leonerd.org.uk
On Sat, 2 Oct 2021 14:26:05 -0700
Darren Duncan <darren@darrenduncan.net> wrote:

> 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.

Definitely can't.

The only way I can think to do it involves lots of hackery at the core
of toke.c and/or perly.y, to make those parts of the tokenizer (yes,
really) be conditional on some flag. Maybe expose those bit-constants
to perl-land via some new global; call it ${^QUIRKS} or somesuch.

Then we'd just have

  package quirk::filetests;
  sub unimport { ${^QUIRKS} |=  0x0001; }
  sub import   { ${^QUIRKS} &= ~0x0001; }

so now we can

  no quirk::filetests;
  ...

But really, 99% of the work is in core .c file source, not pureperl .pm
files.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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