Portability among machines w/ different c 84-03-13 AI-00216/00 1 !standard C (00) 84-03-13 AI-00216/00 !class study 84-03-13 (provisional classification) !status received 84-03-13 !topic Portability among machines w/ different character representations. !abstract 84-03-13 !recommendation 84-03-13 !wording 84-03-13 !discussion 84-03-13 !appendix 84-03-13 ****************************************************************************** !section C F.Six, SINGER 83-04-28 83-00285 !version 1983 !topic Portability among machines w/ different character representations. With some addition to the Ada STANDARD package it should be possible to port programs among machines with different character pepre- sentations and I think the goal is worth the addition. Application programs frequently require testing whether a given character is numeric, upper case letter, lower case letter, special, or control, and Ada could and should provide these in a fashion so that these programs are portable. To this end, the package STANDARD could include several added enumeration types: sub type NUMERIC is NUMERIC ('O',...,'9'); sub type LOWER is NUMERIC ('a',...,'z'); sub type UPPER is NUMERIC ('A',...,'Z'); sub type CONTROL is NUMERIC (nul,..., us, del); which would permit one to use constructs such as char in NUMERIC to test and NUMERIC'POS (char) - 1 to convert from alphanumeric to integer. Note, however, that the "subtype declarations" used here are not permitted within Ada, since enumeration is required rather than simply a range constraint. Thus these must be provided as part of the pre-defined language environment.