
(/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 256)) 

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

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

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

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

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

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

(DEFUN |CHAR;random;$;8| ($)
  (SPADCALL (RANDOM (SPADCALL (QREFELT $ 16))) (QREFELT $ 18))) 

(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| $)
  (QAREF1 (QREFELT $ 10) (+ (QREFELT $ 11) (SPADCALL |c| (QREFELT $ 21))))) 

(DEFUN |CHAR;digit?;$B;13| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 31) (QREFELT $ 33))) 

(DEFUN |CHAR;hexDigit?;$B;14| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 35) (QREFELT $ 33))) 

(DEFUN |CHAR;upperCase?;$B;15| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 37) (QREFELT $ 33))) 

(DEFUN |CHAR;lowerCase?;$B;16| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 39) (QREFELT $ 33))) 

(DEFUN |CHAR;alphabetic?;$B;17| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 41) (QREFELT $ 33))) 

(DEFUN |CHAR;alphanumeric?;$B;18| (|c| $)
  (SPADCALL |c| (|spadConstant| $ 43) (QREFELT $ 33))) 

(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 $ 47)) (QREFELT $ 48)))
   ('T (|error| "String is not a single character")))) 

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

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

(DEFUN |Character| #1=()
  (PROG #1#
    (RETURN
     (PROG (#2=#:G1826)
       (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$| #1=#:G1824 |i|)
    (RETURN
     (SEQ
      (PROGN
       (LETT |dv$| '(|Character|) . #2=(|Character|))
       (LETT $ (GETREFV 54) . #2#)
       (QSETREFV $ 0 |dv$|)
       (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #2#))
       (|haddProp| |$ConstructorCache| '|Character| NIL (CONS 1 $))
       (|stuffDomainSlots| $)
       (QSETREFV $ 6 (|SingleInteger|))
       (QSETREFV $ 10
                 (SPADCALL
                  (PROGN
                   (LETT #1# NIL . #2#)
                   (SEQ (LETT |i| 0 . #2#) G190
                        (COND ((QSGREATERP |i| 255) (GO G191)))
                        (SEQ (EXIT (LETT #1# (CONS (NUM2CHAR |i|) #1#) . #2#)))
                        (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                        (EXIT (NREVERSE0 #1#))))
                  (QREFELT $ 9)))
       (QSETREFV $ 11 0)
       $))))) 

(MAKEPROP '|Character| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL '|Rep| (|List| 28) (|PrimitiveArray| 28)
              (0 . |construct|) '|OutChars| '|minChar| (|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| (5 . |coerce|) |CHAR;random;$;8|
              |CHAR;space;$;9| |CHAR;quote;$;10| |CHAR;escape;$;11|
              (|OutputForm|) |CHAR;coerce;$Of;12| (|CharacterClass|)
              (10 . |digit|) (|Character|) (14 . |member?|) |CHAR;digit?;$B;13|
              (20 . |hexDigit|) |CHAR;hexDigit?;$B;14| (24 . |upperCase|)
              |CHAR;upperCase?;$B;15| (28 . |lowerCase|)
              |CHAR;lowerCase?;$B;16| (32 . |alphabetic|)
              |CHAR;alphabetic?;$B;17| (36 . |alphanumeric|)
              |CHAR;alphanumeric?;$B;18| (|String|) |CHAR;latex;$S;19|
              (40 . |minIndex|) (45 . |elt|) |CHAR;char;S$;20|
              |CHAR;upperCase;2$;21| |CHAR;lowerCase;2$;22| (|List| $)
              (|SingleInteger|))
           '#(~= 51 |upperCase?| 57 |upperCase| 62 |space| 67 |smaller?| 71
              |size| 77 |random| 81 |quote| 85 |ord| 89 |min| 94 |max| 100
              |lowerCase?| 106 |lowerCase| 111 |lookup| 116 |latex| 121 |index|
              126 |hexDigit?| 131 |hash| 136 |escape| 141 |enumerate| 145
              |digit?| 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))
                 (CONS
                  '#(NIL |OrderedSet&| NIL |Finite&| |SetCategory&|
                     |BasicType&| NIL)
                  (CONS
                   '#((|OrderedFinite|) (|OrderedSet|) (|Comparable|)
                      (|Finite|) (|SetCategory|) (|BasicType|)
                      (|CoercibleTo| 28))
                   (|makeByteWordVec2| 53
                                       '(1 8 0 7 9 1 6 0 17 23 0 30 0 31 2 30
                                         12 32 0 33 0 30 0 35 0 30 0 37 0 30 0
                                         39 0 30 0 41 0 30 0 43 1 45 17 0 47 2
                                         45 32 0 17 48 2 0 12 0 0 1 1 0 12 0 38
                                         1 0 0 0 50 0 0 0 25 2 0 12 0 0 1 0 0
                                         15 16 0 0 0 24 0 0 0 26 1 0 17 0 21 2
                                         0 0 0 0 1 2 0 0 0 0 1 1 0 12 0 40 1 0
                                         0 0 51 1 0 19 0 22 1 0 45 0 46 1 0 0
                                         19 20 1 0 12 0 36 1 0 53 0 1 0 0 0 27
                                         0 0 52 1 1 0 12 0 34 1 0 28 0 29 1 0 0
                                         17 18 1 0 0 45 49 1 0 12 0 44 1 0 12 0
                                         42 2 0 12 0 0 1 2 0 12 0 0 1 2 0 12 0
                                         0 13 2 0 12 0 0 1 2 0 12 0 0 14)))))
           '|lookupComplete|)) 

(MAKEPROP '|Character| 'NILADIC T) 
