aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/strap/ALAGG.lsp
blob: e8aa377cac4218813e69215744b24b4e502d6083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(/VERSIONCHECK 2) 

(DEFPARAMETER |AssociationListAggregate;CAT| 'NIL) 

(DEFPARAMETER |AssociationListAggregate;AL| 'NIL) 

(DEFUN |AssociationListAggregate;| (|t#1| |t#2|)
  (LET ((#0=#:G1399
            (|sublisV|
                (PAIR '(|t#1| |t#2|)
                      (LIST (|devaluate| |t#1|) (|devaluate| |t#2|)))
                (|sublisV|
                    (PAIR '(#1=#:G1398)
                          (LIST '(|Record| (|:| |key| |t#1|)
                                     (|:| |entry| |t#2|))))
                    (COND
                      (|AssociationListAggregate;CAT|)
                      ('T
                       (SETQ |AssociationListAggregate;CAT|
                             (|Join| (|TableAggregate| '|t#1| '|t#2|)
                                     (|ListAggregate| '#1#)
                                     (|mkCategory| '|domain|
                                      '(((|assoc|
                                          ((|Union|
                                            (|Record| (|:| |key| |t#1|)
                                             (|:| |entry| |t#2|))
                                            "failed")
                                           |t#1| $))
                                         T))
                                      NIL 'NIL NIL)))))))))
    (|setShellEntry| #0# 0
        (LIST '|AssociationListAggregate| (|devaluate| |t#1|)
              (|devaluate| |t#2|)))
    #0#)) 

(DEFUN |AssociationListAggregate| (&REST #0=#:G1402 &AUX #1=#:G1400)
  (DSETQ #1# #0#)
  (LET ((#2=#:G1401
            (|assoc| (|devaluateList| #1#)
                     |AssociationListAggregate;AL|)))
    (COND
      (#2# (CDR #2#))
      (T (PROGN
           (SETQ #2# (APPLY #'|AssociationListAggregate;| #1#))
           (SETQ |AssociationListAggregate;AL|
                 (|cons5| (CONS (|devaluateList| #1#) #2#)
                          |AssociationListAggregate;AL|))
           #2#)))))