
(/VERSIONCHECK 2) 

(PUT '|ANY;obj;$N;1| '|SPADreplace| 'QCDR) 

(DEFUN |ANY;obj;$N;1| (|x| $) (QCDR |x|)) 

(PUT '|ANY;dom;$Se;2| '|SPADreplace| 'QCAR) 

(DEFUN |ANY;dom;$Se;2| (|x| $) (QCAR |x|)) 

(PUT '|ANY;domainOf;$Of;3| '|SPADreplace| 'QCAR) 

(DEFUN |ANY;domainOf;$Of;3| (|x| $) (QCAR |x|)) 

(DEFUN |ANY;=;2$B;4| (|x| |y| $)
  (COND
    ((SPADCALL (QCAR |x|) (QCAR |y|) (QREFELT $ 17))
     (EQ (QCDR |x|) (QCDR |y|)))
    ('T 'NIL))) 

(DEFUN |ANY;objectOf;$Of;5| (|x| $)
  (|spad2BootCoerce| (QCDR |x|) (QCAR |x|)
      (SPADCALL (SPADCALL "OutputForm" (QREFELT $ 21)) (QREFELT $ 23)))) 

(DEFUN |ANY;showTypeInOutput;BS;6| (|b| $)
  (SEQ (SETELT $ 10 (SPADCALL |b| (QREFELT $ 9)))
       (EXIT (COND
               (|b| "Type of object will be displayed in output of a member of Any")
               ('T
                "Type of object will not be displayed in output of a member of Any"))))) 

(DEFUN |ANY;coerce;$Of;7| (|x| $)
  (PROG (|obj1| |p| |dom1| #0=#:G1836 |a| #1=#:G1837)
    (RETURN
      (SEQ (LETT |obj1| (SPADCALL |x| (QREFELT $ 24))
                 . #2=(|ANY;coerce;$Of;7|))
           (COND
             ((NULL (SPADCALL (QREFELT $ 10) (QREFELT $ 26)))
              (EXIT |obj1|)))
           (LETT |dom1|
                 (SEQ (LETT |p|
                            (|prefix2String| (|devaluate| (QCAR |x|))) . #2#)
                      (EXIT (COND
                              ((SPADCALL |p| (QREFELT $ 27))
                               (SPADCALL |p| (QREFELT $ 23)))
                              ('T (SPADCALL |p| (QREFELT $ 29)))))) . #2#)
           (EXIT (SPADCALL
                     (CONS |obj1|
                           (CONS ":"
                                 (PROGN
                                   (LETT #0# NIL . #2#)
                                   (SEQ (LETT |a| NIL . #2#)
                                    (LETT #1# |dom1| . #2#) G190
                                    (COND
                                      ((OR (ATOM #1#)
                                        (PROGN
                                          (LETT |a| (CAR #1#) . #2#)
                                          NIL))
                                       (GO G191)))
                                    (SEQ
                                     (EXIT
                                      (LETT #0#
                                       (CONS
                                        (SPADCALL |a| (QREFELT $ 30))
                                        #0#) . #2#)))
                                    (LETT #1# (CDR #1#) . #2#)
                                    (GO G190) G191
                                    (EXIT (NREVERSE0 #0#))))))
                     (QREFELT $ 31))))))) 

(DEFUN |ANY;any;SeN$;8| (|domain| |object| $)
  (SEQ (COND
         ((|isValidType| |domain|) (CONS |domain| |object|))
         ('T
          (SEQ (LETT |domain| (|devaluate| |domain|) |ANY;any;SeN$;8|)
               (EXIT (COND
                       ((|isValidType| |domain|)
                        (CONS |domain| |object|))
                       ('T
                        (|error| "function any must have a domain as first argument"))))))))) 

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

(DEFUN |Any;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|Any|) . #0=(|Any|))
        (LETT $ (GETREFV 35) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|Any| NIL (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6
            (|Record| (|:| |dm| (|SExpression|)) (|:| |ob| (|None|))))
        (QSETREFV $ 10 (SPADCALL 'NIL (QREFELT $ 9)))
        $)))) 

(MAKEPROP '|Any| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL '|Rep| (|Boolean|) (|Reference| 7)
             (0 . |ref|) '|printTypeInOutputP| (|None|) |ANY;obj;$N;1|
             (|SExpression|) |ANY;dom;$Se;2| (|OutputForm|)
             |ANY;domainOf;$Of;3| (5 . =) |ANY;=;2$B;4| (|String|)
             (|Symbol|) (11 . |coerce|) (|List| 20) (16 . |list|)
             |ANY;objectOf;$Of;5| |ANY;showTypeInOutput;BS;6|
             (21 . |deref|) (26 . |atom?|) (|List| $) (31 . |list|)
             (36 . |coerce|) (41 . |hconcat|) |ANY;coerce;$Of;7|
             |ANY;any;SeN$;8| (|SingleInteger|))
          '#(~= 46 |showTypeInOutput| 52 |objectOf| 57 |obj| 62 |latex|
             67 |hash| 72 |domainOf| 77 |dom| 82 |coerce| 87 |any| 92 =
             98)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0))
                (CONS '#(|SetCategory&| |BasicType&| NIL)
                      (CONS '#((|SetCategory|) (|BasicType|)
                               (|CoercibleTo| 15))
                            (|makeByteWordVec2| 34
                                '(1 8 0 7 9 2 13 7 0 0 17 1 20 0 19 21
                                  1 22 0 20 23 1 8 7 0 26 1 13 7 0 27 1
                                  20 28 0 29 1 20 15 0 30 1 15 0 28 31
                                  2 0 7 0 0 1 1 0 19 7 25 1 0 15 0 24 1
                                  0 11 0 12 1 0 19 0 1 1 0 34 0 1 1 0
                                  15 0 16 1 0 13 0 14 1 0 15 0 32 2 0 0
                                  13 11 33 2 0 7 0 0 18)))))
          '|lookupComplete|)) 

(MAKEPROP '|Any| 'NILADIC T) 
