On Wed, Dec 22, 2010 at 3:43 PM, Amitava Shee <amitava.s...@gmail.com>wrote:

>
> Can someone more qualified than I explain why a recur from a try poses
> a problem?
>
> I am copying the relevant parts of the source below
>
> clojure.tmbundle/Support/repl.clj
> ==================================
> (defn repl
>  "runs a repl on ins and outs until eof"
>  [ins outs]
>    (binding [*ns* (create-ns 'user)
>              *warn-on-reflection* false
>              *out* (new OutputStreamWriter outs)]
>      (let [eof (new Object)
>            r (new LineNumberingPushbackReader (new InputStreamReader
> ins))]
>        (loop [e (read r false eof)]
>          (when-not (or (= e :repl_eof) (= e eof))
>            (try
>              (prn (eval e))
>              (flush)
>              (recur (read r false eof))
>            (catch Throwable e
>              (let [c (extract-root-cause e)]
>                (if (isa? Compiler$CompilerException e)
>                  (println e)
>                  (println c)))
>              (flush))))))))
>
> Thanks,
> Amitava


I don't know the details, but the ticket is here:

http://dev.clojure.org/jira/browse/CLJ-31?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel#issue-tabs

Perhaps better if the REPL caught exceptions in the manner that Clojure's
REPL does:

https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L115

David

-- 
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