diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-12-11 20:47:25 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-12-22 11:11:27 -0700 |
commit | 15861f948fe52aa0c72233cd9dfc0190bfa3fbb1 (patch) | |
tree | 68e1d074c5f89237a0bcbc739836c5aac749cac9 /pp_hot.c | |
parent | fbc19f27a35cc90f77285a47de2ff0dd21ff50c6 (diff) | |
download | perl-15861f948fe52aa0c72233cd9dfc0190bfa3fbb1.tar.gz |
handy.h: Create isALPHANUMERIC() and kin
Perl has had an undocumented macro isALNUMC() for a long time. I want
to document it, but the name is very obscure. Neither Yves nor I are
sure what it is. My best guess is "C's alnum". It corresponds to
/[[:alnum:]]/, and so its best name would be isALNUM(). But that is the
name long given to what matches \w. A new synonym, isWORDCHAR(), has
been in place for several releases for that, but the old isALNUM()
should remain for backwards compatibility.
I don't think that the name isALNUMC() should be published, as it is too
close to isALNUM(). I finally came to the conclusion that
isALPHANUMERIC() is the best name; it describes its purpose clearly; the
disadvantage is its long length. I doubt that it will get much use, but
we need something, I think, that we can publish to accomplish this
functionality.
This commit also converts core uses of isALNUMC to isALPHANUMERIC. (I
intended to that separately, but made a mistake in rebasing, and
combined the two patches; and it seemed like not a big enough problem to
separate them out again.)
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1813,7 +1813,7 @@ Perl_do_readline(pTHX) } } for (t1 = SvPVX_const(sv); *t1; t1++) - if (!isALNUMC(*t1) && + if (!isALPHANUMERIC(*t1) && strchr("$&*(){}[]'\";\\|?<>~`", *t1)) break; if (*t1 && PerlLIO_lstat(SvPVX_const(sv), &PL_statbuf) < 0) { |