 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Compilable
 
-(defn compile-expr [argmap expr cb]
-  (cb argmap [:compiled expr]))
+(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

                   :header (spec/? ::sized-type)
                   :data ::sized-type))

(spec/def ::type (spec/or :sized-type ::sized-type
                          :primitive ::primitive
                          :array ::array
                          :dynamic ::dynamic))
                       

    (empty? (rest exprs)) (compile-expr argmap (first exprs) cb)
    :default (compile-expr 
              argmap (first exprs)
              (fn [new-argmap x]
                (check-is-value x)
                (compile-exprs new-argmap (rest exprs) cb)))))

(defn export-typed-value [value]
  [:export value])

(defmacro with-typed [& args]
  (let [parsed (spec/conform ::exprs args)]
