 
 (deftype Join [seek-key iterators var->iterators ^:mutable end?]
   Object
+  (reset [this]
+         (prn)
+         (prn :reset)
+         (dotimes [i (alength iterators)]
+           (.reset (aget iterators i)))
+         (dotimes [i (alength seek-key)]
+           (aset seek-key i least))
+         (set! end? false)
+         (.down this -1))
   (key [this]
        (when (false? end?)
          seek-key))

                num-iterators (alength iterators)]
            (loop [max-key (.key-at (aget iterators (- num-iterators 1)) var)
                   current 0]
              (prn :search max-key current)
              (let [iterator (aget iterators current)
                    min-key (.key-at iterator var)]
                (aset seek-key var max-key)

            (.search this new-var)))))
  (down [this old-var old-key]
        ;; assumes prefixes all equal, nothing at end
        (prn :down old-var old-key seek-key)
        (if (== old-var (- (alength var->iterators) 1))
          (aset seek-key old-var old-key) ;; done
          (let [new-var (+ old-var 1)
