I'm trying to understand the clojurescript-code of the repl functionality, and 
I'm confused…

The following cljs.repl/eval-and-print function takes a cljs-form, compiles it, 
sends it to the browser as javascript, and then receives the result, and the… 
try's to use "read-string" on that return value:

---
(defn- eval-and-print [repl-env env form]
  (let [ret (evaluate-form repl-env
                           (assoc env :ns (ana/get-namespace ana/*cljs-ns*))
                           "<cljs repl>"
                           form
                           (wrap-fn form))]
    (try (prn (read-string ret))
         (catch Exception e
           (if (string? ret)
             (println ret)
             (prn nil))))))
---

Why does it call read-string on the returned result from the js-eval?

The eval'ed compiled javascript could result in a clojure-form that would be 
eval'ed on the return (???), and the result of the latter is then printed.

Confusingly yours, FrankS.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to