develooper Front page | perl.perl6.language | Postings from April 2005

should we change [^a-z] to <-[a..z]> instead of <-[a-z]>?

Thread Next
Larry Wall
April 14, 2005 17:21
should we change [^a-z] to <-[a..z]> instead of <-[a-z]>?
Message ID:
In writing some character class translation, I realized that


and its ilk are rather hard to read because of the two hyphens
that mean different things.  We can't use <![a-z]> because that's a
0-width lookahead.  Given that we're trying to get rid of special
exceptions, and - in character classes is weird, and we already
use .. for ranges everywhere else, and nobody is going to put a
repeated character into a character class, I'm wondering if


should be allowed/encouraged/required.  It greatly improves the
readability in my estimation.  The only problem with requiring .. is
that people *will* write <[a-z]> out of habit, and we would probably
have to outlaw the - form for many years before everyone would get
used to the .. form.  So maybe we allow - but warn if not backslashed.


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