               (str "Failed to parsed typed: " 
                    (spec/explain-str ::exprs args))))
       (compile-exprs empty-argmap parsed (fn [final-argmap final-value]
-                                           [:final final-value])))))
+                                           (check-is-value final-value)
+                                           (export-typed-value final-value))))))
   
   
-(macroexpand '(with-typed 9 (+ 4 5)))
+(macroexpand '(with-typed 9 4 5 6))

            [epicea.utils.access :as access] :reload-all))

(spec/def ::unspecified nil?)
(spec/def ::bool boolean?)
(spec/def ::float float?)
(spec/def ::double double?)
(spec/def ::long #(instance? java.lang.Long %))
(spec/def ::int #(instance? java.lang.Integer %))
(spec/def ::primitive (spec/or
                       :bool (partial = :bool)
                       :float (partial = :float)
                       :long (partial = :long)
                       :double (partial = :double)
                       :int (partial = :int)))
(spec/def ::dynamic (partial = :dynamic))

(spec/def ::number (spec/or :type #(or (= % :number)
                                       (= % :double))
                            :literal number?))
(spec/def ::count number?)
(spec/def ::key keyword?)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Compilable

(defn expr-access [i]
  (access/vector-accessor i {:default-parent [nil nil]}))
(def expr-type (expr-access 0))
(def expr-value (expr-access 1))

(defmultiple compile-expr (fn [argmap expr cb]
                            (access/getx expr-type expr))
  (:default 
   [argmap expr cb]
   (cb argmap {:type (spec/conform ::type (access/getx expr-value expr))
               :repr expr})))

(def empty-argmap {})


(defn value? [x]
  (and (map? x)
       (contains? x :type)
       (contains? x :repr)))

(defn check-is-value [x]
  (if (not (value? x))
    (throw (RuntimeException. 
            (str "Invalid value: " x)))))

(defn compile-exprs [argmap exprs cb]
  (cond
