    :var var
    :pattern pattern})
 
+(def match-any
+  {:type :match/any})
+
+(defn match-value [value]
+  {:type :match/value
+   :value value})
+
+(defn match-vector [& values]
+  {:type :match/vec
+   :value (into [] values)})
+
+(defn match-map [& keys&values]
+  {:type :match/map
+   :value (into {} (map vec (partition 2 keys&values)))})
+
 ;; examples
 
 (def example-a


(def example-b
  {"root" (pipe ["x"]
                "result" ["x"] (match {"a" (bind "a" (cljs-ref number?)) "b" (bind "b" (cljs-ref number?))} ["a" "b"] (cljs-ref -)
                                      [(bind "x" (value true)) "foo"] ["x"] (cljs-ref identity)))})

(def example-c
  {"root" (pipe-ref "even?")
   "even?" (pipe ["x"]
                 "result" ["x"] (match 0 [] (value true)
                                       (bind "x" (value true)) ["x"] (pipe-ref "even?not-0")))
   "even?not-0" (pipe ["x"]
                      "one" [] (value 1)
                      "x-1" ["x" "one"] (cljs-ref -)
                      "odd?" ["x-1"] (pipe-ref "odd?")
                      "result" ["odd?"] (cljs-ref not))
   "odd?" (pipe ["x"]
                "result" ["x"] (match 0 [] (value true)
                                      (bind "x" (value true)) ["x"] (pipe-ref "odd?not-0")))
   "odd?not-0" (pipe ["x"]
                     "one" [] (value 1)
                     "x-1" ["x" "one"] (cljs-ref -)


(defn run-pipe [program node inputs actions]
  (prn node inputs)
  (assert (= :pipe (:type node)))
  (let [vars #js {}]
    (doseq [[id value] (map vector (:inputs node) inputs)]
      (aset vars id value))
