Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/4th/lib/istype.4th

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


\ 4tH library - TOOLBELT IS-TYPE - Copyright 2004 J.L. Bezemer
\ You can redistribute this file and/or modify it under
\ the terms of the GNU General Public License

[UNDEFINED] IS-ASCII [IF]
: IS-ASCII  ( char -- flag )  128 < ;
: IS-PRINT  ( char -- flag )  DUP IS-ASCII SWAP BL 1- - 0> AND ;
: IS-WHITE  ( char -- flag )  [CHAR] ! - 0< ;
: IS-DIGIT  ( char -- flag )  [CHAR] 0 - MAX-N AND 10 < ;
: IS-LOWER  ( char -- flag )  [CHAR] a - MAX-N AND 26 < ;
: IS-UPPER  ( char -- flag )  [CHAR] A - MAX-N AND 26 < ;
: IS-ALPHA  ( char -- flag )  BL OR IS-LOWER ;
: IS-ALNUM  ( char -- flag )  DUP IS-ALPHA SWAP IS-DIGIT OR ;
[THEN]

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.