ox-lang / ox

Ox - An immutable statically typed Lisp for the JVM
https://ox-lang.org
66 stars 3 forks source link

read-eval currently broken #13

Closed arrdem closed 9 years ago

arrdem commented 9 years ago

Consider

(let [x 3]
  {:a 1
   :b x})

As presently implemented, this will read into something along the lines of

(let [x 3]
  (read-eval
    (->map [[(keyword "a") 1]
            [(keyword "b") x]])))

Which is incorrect because the binding x isn't evaluated during read-eval expansion. This read-eval implementaiton is generally incorrect for cases involving captured local expressions and needs to be reworked as a result.

arrdem commented 9 years ago
ox.lang.parser> (parse-string "(let [x 3]
  {:a 1
   :b x})")
=> (let (vector (x 3))
        (hash-map (((keyword "a") 1)
                   ((keyword "b") x))))