lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I see from the list archives that this is a pretty low-demand request,
but I could do with some way to access isprint and isgraph, in order
to test whether characters fall into that class.

The most consistent way with present practice would be to add regex
character classes for them. Looking at the current list in lstrlib.c,
the only functions not implemented are indeed isgraph and isprint (as
well as, correctly unimplemented, the obsolete isascii, and the C99
isblank).

So, could we have them, please? The strict definitions in the ISO C
standard are not as straightforward as isgraph == ispunct || isalnum
|| isspace, isprint == !iscntrl[0], and even if they were, we
programmers shouldn't have to work that out.

[0] For the gory details, see
http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap07.html
It's not much fun. Certain space characters can be in isgraph and
isprint, depending on the locale. Yes, I know that strictly that link
is not to the ISO standard, but it's to something that's trying to
conform.

-- 
http://rrt.sc3d.org