
(/VERSIONCHECK 2) 

(PUT '|CHAR;=;2$B;1| '|SPADreplace| 'EQL) 

(DEFUN |CHAR;=;2$B;1| (|a| |b| $) (EQL |a| |b|)) 

(PUT '|CHAR;<;2$B;2| '|SPADreplace| 'QSLESSP) 

(DEFUN |CHAR;<;2$B;2| (|a| |b| $) (QSLESSP |a| |b|)) 

(PUT '|CHAR;size;Nni;3| '|SPADreplace| '(XLAM NIL 1114112)) 

(DEFUN |CHAR;size;Nni;3| ($) 1114112) 

(DEFUN |CHAR;index;Pi$;4| (|n| $) (SPADCALL (- |n| 1) (QREFELT $ 13))) 

(DEFUN |CHAR;lookup;$Pi;5| (|c| $)
  (PROG (#1=#:G1799)
    (RETURN
     (PROG1 (LETT #1# (+ 1 (SPADCALL |c| (QREFELT $ 16))) |CHAR;lookup;$Pi;5|)
       (|check-subtype| (> #1# 0) '(|PositiveInteger|) #1#))))) 

(DEFUN |CHAR;char;I$;6| (|n| $) (SPADCALL |n| (QREFELT $ 18))) 

(PUT '|CHAR;ord;$I;7| '|SPADreplace| '(XLAM (|c|) |c|)) 

(DEFUN |CHAR;ord;$I;7| (|c| $) |c|) 

(DEFUN |CHAR;random;$;8| ($) (SPADCALL (RANDOM 128) (QREFELT $ 13))) 

(PUT '|CHAR;space;$;9| '|SPADreplace| '(XLAM NIL (QENUM "   " 0))) 

(DEFUN |CHAR;space;$;9| ($) (QENUM "   " 0)) 

(PUT '|CHAR;quote;$;10| '|SPADreplace| '(XLAM NIL (QENUM "\" " 0))) 

(DEFUN |CHAR;quote;$;10| ($) (QENUM "\" " 0)) 

(PUT '|CHAR;escape;$;11| '|SPADreplace| '(XLAM NIL (QENUM "_ " 0))) 

(DEFUN |CHAR;escape;$;11| ($) (QENUM "_ " 0)) 

(DEFUN |CHAR;coerce;$Of;12| (|c| $) (NUM2USTR (SPADCALL |c| (QREFELT $ 16)))) 

(DEFUN |CHAR;digit?;$B;13| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 26) (QREFELT $ 28))) 

(DEFUN |CHAR;hexDigit?;$B;14| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 30) (QREFELT $ 28))) 

(DEFUN |CHAR;upperCase?;$B;15| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 32) (QREFELT $ 28))) 

(DEFUN |CHAR;lowerCase?;$B;16| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 34) (QREFELT $ 28))) 

(DEFUN |CHAR;alphabetic?;$B;17| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 36) (QREFELT $ 28))) 

(DEFUN |CHAR;alphanumeric?;$B;18| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 38) (QREFELT $ 28))) 

(DEFUN |CHAR;latex;$S;19| (|c| $)
  (STRCONC "\\mbox{`" (STRCONC (MAKE-FULL-CVEC 1 |c|) "'}"))) 

(DEFUN |CHAR;char;S$;20| (|s| $)
  (COND
   ((EQL (QCSIZE |s|) 1)
    (SPADCALL |s| (SPADCALL |s| (QREFELT $ 42)) (QREFELT $ 43)))
   ('T (|error| "String is not a single character")))) 

(DEFUN |CHAR;upperCase;2$;21| (|c| $)
  (QENUM (PNAME (UPCASE (NUM2CHAR (SPADCALL |c| (QREFELT $ 16))))) 0)) 

(DEFUN |CHAR;lowerCase;2$;22| (|c| $)
  (QENUM (PNAME (DOWNCASE (NUM2CHAR (SPADCALL |c| (QREFELT $ 16))))) 0)) 

(DEFUN |Character| #1=()
  (PROG #1#
    (RETURN
     (PROG (#2=#:G1824)
       (RETURN
        (COND
         ((LETT #2# (HGET |$ConstructorCache| '|Character|) . #3=(|Character|))
          (|CDRwithIncrement| (CDAR #2#)))
         ('T
          (UNWIND-PROTECT
              (PROG1
                  (CDDAR
                   (HPUT |$ConstructorCache| '|Character|
                         (LIST (CONS NIL (CONS 1 (|Character;|))))))
                (LETT #2# T . #3#))
            (COND ((NOT #2#) (HREM |$ConstructorCache| '|Character|))))))))))) 

(DEFUN |Character;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
     (PROGN
      (LETT |dv$| '(|Character|) . #1=(|Character|))
      (LETT $ (GETREFV 50) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|Character| NIL (CONS 1 $))
      (|stuffDomainSlots| $)
      (SETF |pv$| (QREFELT $ 3))
      (QSETREFV $ 6 (|SingleInteger|))
      $)))) 

(MAKEPROP '|Character| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL '|Rep| (|Boolean|) |CHAR;=;2$B;1|
              |CHAR;<;2$B;2| (|NonNegativeInteger|) |CHAR;size;Nni;3|
              (|Integer|) |CHAR;char;I$;6| (|PositiveInteger|)
              |CHAR;index;Pi$;4| |CHAR;ord;$I;7| |CHAR;lookup;$Pi;5|
              (0 . |coerce|) |CHAR;random;$;8| |CHAR;space;$;9|
              |CHAR;quote;$;10| |CHAR;escape;$;11| (|OutputForm|)
              |CHAR;coerce;$Of;12| (|CharacterClass|) (5 . |digit|)
              (|Character|) (9 . |member?|) |CHAR;digit?;$B;13|
              (15 . |hexDigit|) |CHAR;hexDigit?;$B;14| (19 . |upperCase|)
              |CHAR;upperCase?;$B;15| (23 . |lowerCase|)
              |CHAR;lowerCase?;$B;16| (27 . |alphabetic|)
              |CHAR;alphabetic?;$B;17| (31 . |alphanumeric|)
              |CHAR;alphanumeric?;$B;18| (|String|) |CHAR;latex;$S;19|
              (35 . |minIndex|) (40 . |elt|) |CHAR;char;S$;20|
              |CHAR;upperCase;2$;21| |CHAR;lowerCase;2$;22| (|InputForm|)
              (|List| $) (|SingleInteger|))
           '#(~= 46 |upperCase?| 52 |upperCase| 57 |space| 62 |smaller?| 66
              |size| 72 |random| 76 |quote| 80 |ord| 84 |min| 89 |max| 95
              |lowerCase?| 101 |lowerCase| 106 |lookup| 111 |latex| 116 |index|
              121 |hexDigit?| 126 |hash| 131 |escape| 136 |enumerate| 140
              |digit?| 144 |convert| 149 |coerce| 154 |char| 159
              |alphanumeric?| 169 |alphabetic?| 174 >= 179 > 185 = 191 <= 197 <
              203)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0 0))
                 (CONS
                  '#(NIL |OrderedSet&| NIL |Finite&| |SetCategory&| NIL
                     |BasicType&| NIL)
                  (CONS
                   '#((|OrderedFinite|) (|OrderedSet|) (|Comparable|)
                      (|Finite|) (|SetCategory|) (|ConvertibleTo| 47)
                      (|BasicType|) (|CoercibleTo| 23))
                   (|makeByteWordVec2| 49
                                       '(1 6 0 12 18 0 25 0 26 2 25 7 27 0 28 0
                                         25 0 30 0 25 0 32 0 25 0 34 0 25 0 36
                                         0 25 0 38 1 40 12 0 42 2 40 27 0 12 43
                                         2 0 7 0 0 1 1 0 7 0 33 1 0 0 0 45 0 0
                                         0 20 2 0 7 0 0 1 0 0 10 11 0 0 0 19 0
                                         0 0 21 1 0 12 0 16 2 0 0 0 0 1 2 0 0 0
                                         0 1 1 0 7 0 35 1 0 0 0 46 1 0 14 0 17
                                         1 0 40 0 41 1 0 0 14 15 1 0 7 0 31 1 0
                                         49 0 1 0 0 0 22 0 0 48 1 1 0 7 0 29 1
                                         0 47 0 1 1 0 23 0 24 1 0 0 40 44 1 0 0
                                         12 13 1 0 7 0 39 1 0 7 0 37 2 0 7 0 0
                                         1 2 0 7 0 0 1 2 0 7 0 0 8 2 0 7 0 0 1
                                         2 0 7 0 0 9)))))
           '|lookupComplete|)) 

(MAKEPROP '|Character| 'NILADIC T) 
