           (fn [result] (:value result)))))
 
 (defmethod read "repl"
-  [{:keys [state ast] :as env} k {:keys [:repl/input] :as data}]
+  [{:keys [state ast] :as env} k {:keys [:repl/input :repl/packets] :as data}]
   (case k
     :repl/output
     (let [old-value (get @state k "Loading...")]
+      (js/console.log "hi" "from" input (count (:packets @state)))
       {:value (read-expr input)})))
 
 (defmethod read "packets"
-  [{:keys [state ast] :as env} k {:keys [idx offset limit]}]
+  [{:keys [state ast] :as env} k {:keys [idx offset limit repl-input]}]
   (case k
     :packets/packet
     {:value (when idx (nth (get @state :packets) idx))}
 
     :packets/count
     {:value (-> @state :packets count)}
+
+    :packets/repl-output
+    (let [x (read-expr repl-input)]
+      {:value
+       (if (fn? x)
+         (into [] x (:packets @state))
+         x)})
+
 
     :packets/slice
     (let [packets (get @state :packets)]

                  #js {:width (- 800 150)
                       :header (jsx Cell #js {} "Data")
                       :cell (data-cell offset packets)}))
        (when output (str "Repl output: " (with-out-str (pprint output))))
        (when packet
          (dom/div nil (js/JSON.stringify packet)))))))


(def root (om/factory RootComponent))

                  (om/update-query!
                   this
                   (fn [s] (assoc-in s [:params :repl-input] new-value)))))})
        (when packets
          (dom/p nil
                 (str "Loaded " packets-count " packets. " parser-state)))
