! char.ax.txt - character and symbol utility predicates ! uses ! form.ax.txt - expression "form" utilities ! bit.ax.txt - bit utilities ! ho.ax.txt - higher-order utilities ----+----|----+----|----+----|----+----|----+----|----+----|----+----|----+----8 !/ char_atom - distinguishing atom for a syntax-extension character char - set of (8-bit) characters charseq - sequence of characters pchar - set of printable characters (x20..x7E) digit - decimal digit char ('0' - '9') letteru - uppercase letter ('A' - 'Z') letterl - lowercase letter ('a' - 'z') letter - upper- or lower-case letter write - write a "tree" of characters to a flat string ===== symbol utilities ===== symbol_atom - distinguishing atom for a syntax-extension symbol symbol - set of syntax-extension symbols !\ ! char_atom - distinguishing atom for a syntax-extension character (char_atom `char). ! char - set of syntax-extension characters (which have 8 bits) (char (%char_atom %8bits))< (char_atom %char_atom), (bitseq %8bits), (=len %8bits (* * * * * * * *)). ! Note that <, <= ordering between chars derives from bit ordering. ! Do we need to define ordering between char and char sequence?? ! charseq - set of character sequences (def charseq (* char)). ! pchar - set of printable characters (x20..x7E) (pchar (%char_atom %8bits))< ! printable char (char (%char_atom %8bits)), ! get char atom and its 8 bits (bits %0 %1), ! get 0,1 bit atoms (<= (%0 %0 %1 %0 %0 %0 %0 %0) %8bits), ! x20..x7E (<= %8bits (%0 %1 %1 %1 %1 %1 %1 %0)). !z (one_valid (== %8bits (`0 `0 `1 $)) ! x20..3F !z (== %8bits (`0 `1 $))). ! x40..7F !z ! -- this covers ASCII 20..7F (but we should probably exclude 7F) ! digit - decimal digit char (digit %digit)< (char %digit), (<= '0' %digit), (<= %digit '9'). ! letteru - uppercase letter ('A' - 'Z') (letteru %ultr)< (char %ultr), (<= 'A' %ultr), (<= %ultr 'Z'). ! letterl - lowercase letter ('a' - 'z') (letterl %lltr)< (char %lltr), (<= 'a' %lltr), (<= %lltr 'z'). ! letter - upper- or lower-case letter (letter %ltr)< (one_valid (letteru %ltr) (letterl %ltr)). ! write - write a "tree" of characters to a flat char string (write %char (%char))< (char %char). (write () ()). (write (% $) %charstr)< (write % %charstr1), (write ($) %charstr2).har (concat %charstr1 %charstr2 %charstr). ! ===== symbol utilities ===== ! symbol_atom - distinguishing atom for a syntax-extension symbol (symbol_atom `). ! alternative: `sym ! symbol - set of syntax-extension symbols (symbol (%sym_atom (%c1)))< (symbol_atom %sym_atom), (pchar %c1), ! 1st symbol char is printable char (/in %c0 " `%$'""!()") ! other than blank ` % $ ' " ! ( ) (symbol (%sym_atom ($cstr %c)))< (symbol (%sym_atom ($cstr))), (pchar %c), ! remaining symbol chars are printable chars (/in %c " ()"). ! other than blank ( )