5.10? and /x, /u, ... for ack 3 Re: [ack-dev] ack 3

4 views
Skip to first unread message

Bill Ricker

unread,
Feb 24, 2017, 6:07:12 PM2/24/17
to Andy Lester, ack...@googlegroups.com
On Thu, Feb 23, 2017 at 11:34 PM, Andy Lester <an...@petdance.com> wrote:
> I'm also thinking that we can safely require Perl 5.10.

Do i recall the 5.10.0 was the dot-uh-oh?
Do we want to say 5.10.1 ?
OTOH, if we avoid the deprecated given/when and smartmatch does 5.10.0 matter?

For ack3, do we want to be more aggressive than 5.10?
How backward are the Sun and RedHat supported /bin/perl today ?

Can we go for 5.12?
http://perldoc.perl.org/5.12.0/perldelta.html
Nothing really compelling in 5.12.0 ...

How about 5.14's Unicode v6 & use feature 'unicode_strings'; ?
http://perldoc.perl.org/5.14.0/perldelta.html
Would that help users if we invoked use feature 'unicode_strings';
(and debugged it) in ack3 so that Unicode really works everywhere ?

use 514 would guarantee ack can users can select (?l) Locale, (?u)
Unicode, (?d) revoke both l & u, and (?a) and (?aa) on their RE, and
allow us to have those RE options in ackrc and on commandline too.


> This [5.10] will give us state variables, which I suspect may be very useful.

statevars can be quite useful, even if the FP theorists frown.
We could always use closures to get a similar effect but these are
clean looking.

However they may introduce bugs if used for something that like $.
should reset for every file. Tests that work with one test file may
fail with two.


> highlighting getting screwed up on capture groups.

that reminds me of my Desiderata ...

I would like to make it easier to use (?x) expanded syntax with ack on
command line, without having to use (?x: NON capture group) or the
vestigial (?x) interior flag. Maybe only perl-hackers will use
expanded syntax ... obviously newlines and comments aren't very useful
on ack commandline but non-semantic horizontal whitespace is ! And if
man ack3 and beyondgrep.com/documentation3/ expose non-perl folks to
the /x readable syntax it may spread the good news !

Alas we already used -x for read list of files from STDIN in ack2.
The obvious --expanded-re would work in my .ackrc but not convenient
on commandline.
maybe -X ? or -O=[xdula...]+ for any /x (?x) (so -O=i is same as -i )

(Yes, 5.10 is new enough ... /x was NOT new in 5.10.00 . -O=u could be
meaningless ignored in 5.10 or a trapped error, and function as
intended if ack running on 5.14 or better ? )




--
Bill Ricker
bill....@gmail.com
https://www.linkedin.com/in/n1vux
Reply all
Reply to author
Forward
0 new messages