
(/VERSIONCHECK 2) 

(DEFUN |TUPLE;coerce;Pa$;1| (|x| $) (CONS (QVSIZE |x|) |x|)) 

(PUT '|TUPLE;coerce;$Pa;2| '|SPADreplace| 'QCDR) 

(DEFUN |TUPLE;coerce;$Pa;2| (|x| $) (QCDR |x|)) 

(PUT '|TUPLE;length;$Nni;3| '|SPADreplace| 'QCAR) 

(DEFUN |TUPLE;length;$Nni;3| (|x| $) (QCAR |x|)) 

(DEFUN |TUPLE;select;$NniS;4| (|x| |n| $)
  (COND ((>= |n| (QCAR |x|)) (|error| "Index out of bounds"))
        ('T (QAREF1 (QCDR |x|) |n|)))) 

(DEFUN |TUPLE;=;2$B;5| (|x| |y| $)
  (COND
   ((EQL (QCAR |x|) (QCAR |y|))
    (SPADCALL (QCDR |x|) (QCDR |y|) (QREFELT $ 15)))
   ('T 'NIL))) 

(DEFUN |TUPLE;coerce;$Of;6| (|x| $)
  (PROG (#1=#:G1818 |i| #2=#:G1817)
    (RETURN
     (SEQ
      (SPADCALL
       (PROGN
        (LETT #2# NIL . #3=(|TUPLE;coerce;$Of;6|))
        (SEQ (LETT |i| 0 . #3#)
             (LETT #1# (SPADCALL (QCDR |x|) (QREFELT $ 18)) . #3#) G190
             (COND ((QSGREATERP |i| #1#) (GO G191)))
             (SEQ
              (EXIT
               (LETT #2#
                     (CONS (SPADCALL (QAREF1 (QCDR |x|) |i|) (QREFELT $ 20))
                           #2#)
                     . #3#)))
             (LETT |i| (QSADD1 |i|) . #3#) (GO G190) G191
             (EXIT (NREVERSE #2#))))
       (QREFELT $ 22)))))) 

(DEFUN |Tuple| (#1=#:G1819)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1820)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache| '|Tuple|)
                                           '|domainEqualList|)
                . #3=(|Tuple|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT (PROG1 (|Tuple;| #1#) (LETT #2# T . #3#))
            (COND ((NOT #2#) (HREM |$ConstructorCache| '|Tuple|))))))))))) 

(DEFUN |Tuple;| (|#1|)
  (PROG (|pv$| $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|Tuple|))
      (LETT |dv$| (LIST '|Tuple| DV$1) . #1#)
      (LETT $ (GETREFV 26) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| |#1| '(|SetCategory|))
                                          (|HasCategory| |#1|
                                                         '(|CoercibleTo|
                                                           (|OutputForm|)))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|Tuple| (LIST DV$1) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (SETF |pv$| (QREFELT $ 3))
      (QSETREFV $ 7
                (|Record| (|:| |len| (|NonNegativeInteger|))
                          (|:| |elts| (|PrimitiveArray| |#1|))))
      (COND
       ((|testBitVector| |pv$| 1)
        (QSETREFV $ 16 (CONS (|dispatchFunction| |TUPLE;=;2$B;5|) $))))
      (COND
       ((|testBitVector| |pv$| 2)
        (QSETREFV $ 23 (CONS (|dispatchFunction| |TUPLE;coerce;$Of;6|) $))))
      $)))) 

(MAKEPROP '|Tuple| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) '|Rep|
              (|PrimitiveArray| 6) |TUPLE;coerce;Pa$;1| |TUPLE;coerce;$Pa;2|
              (|NonNegativeInteger|) |TUPLE;length;$Nni;3|
              |TUPLE;select;$NniS;4| (|Boolean|) (0 . =) (6 . =) (|Integer|)
              (12 . |maxIndex|) (|OutputForm|) (17 . |coerce|) (|List| $)
              (22 . |paren|) (27 . |coerce|) (|String|) (|SingleInteger|))
           '#(~= 32 |select| 38 |length| 44 |latex| 49 |hash| 54 |coerce| 59 =
              74)
           'NIL
           (CONS (|makeByteWordVec2| 2 '(1 0 1 2))
                 (CONS '#(|SetCategory&| NIL |BasicType&| NIL)
                       (CONS
                        '#((|SetCategory|) (|CoercibleTo| (|PrimitiveArray| 6))
                           (|BasicType|) (|CoercibleTo| 19))
                        (|makeByteWordVec2| 25
                                            '(2 8 14 0 0 15 2 0 14 0 0 16 1 8
                                              17 0 18 1 6 19 0 20 1 19 0 21 22
                                              1 0 19 0 23 2 1 14 0 0 1 2 0 6 0
                                              11 13 1 0 11 0 12 1 1 24 0 1 1 1
                                              25 0 1 1 2 19 0 23 1 0 0 8 9 1 0
                                              8 0 10 2 1 14 0 0 16)))))
           '|lookupComplete|)) 
