
(/VERSIONCHECK 2) 

(DEFPARAMETER |LazyStreamAggregate;CAT| 'NIL) 

(DEFPARAMETER |LazyStreamAggregate;AL| 'NIL) 

(DEFUN |LazyStreamAggregate| (#0=#:G1906)
  (LET (#1=#:G1907)
    (COND
      ((SETQ #1#
             (|assoc| #2=(|devaluate| #0#) |LazyStreamAggregate;AL|))
       (CDR #1#))
      (T (SETQ |LazyStreamAggregate;AL|
               (|cons5| (CONS #2#
                              (SETQ #1# (|LazyStreamAggregate;| #0#)))
                        |LazyStreamAggregate;AL|))
         #1#)))) 

(DEFUN |LazyStreamAggregate;| (|t#1|)
  (PROG (#0=#:G1905)
    (RETURN
      (PROG1 (LETT #0#
                   (|sublisV|
                       (PAIR '(|t#1|) (LIST (|devaluate| |t#1|)))
                       (COND
                         (|LazyStreamAggregate;CAT|)
                         ('T
                          (LETT |LazyStreamAggregate;CAT|
                                (|Join| (|StreamAggregate| '|t#1|)
                                        (|mkCategory| '|domain|
                                         '(((|remove|
                                             ($
                                              (|Mapping| (|Boolean|)
                                               |t#1|)
                                              $))
                                            T)
                                           ((|select|
                                             ($
                                              (|Mapping| (|Boolean|)
                                               |t#1|)
                                              $))
                                            T)
                                           ((|explicitEntries?|
                                             ((|Boolean|) $))
                                            T)
                                           ((|explicitlyEmpty?|
                                             ((|Boolean|) $))
                                            T)
                                           ((|lazy?| ((|Boolean|) $))
                                            T)
                                           ((|lazyEvaluate| ($ $)) T)
                                           ((|frst| (|t#1| $)) T)
                                           ((|rst| ($ $)) T)
                                           ((|numberOfComputedEntries|
                                             ((|NonNegativeInteger|) $))
                                            T)
                                           ((|extend|
                                             ($ $ (|Integer|)))
                                            T)
                                           ((|complete| ($ $)) T))
                                         NIL
                                         '((|Integer|)
                                           (|NonNegativeInteger|)
                                           (|Boolean|))
                                         NIL))
                                . #1=(|LazyStreamAggregate|))))) . #1#)
        (SETELT #0# 0
                (LIST '|LazyStreamAggregate| (|devaluate| |t#1|))))))) 
