On Mon, Jan 24, 2011 at 7:26 PM, Aaron Cohen <aa...@assonance.org> wrote:
> The inner exception to me should clearly be caught and not rethrown.
> So I would really expect to see two printouts when this is run, once
> for doit and once for close.

Neither would I. I think you've misunderstood something, though.

> Why would the finally block of an outer try statement be called when
> an inner try has already caught the exception?

A finally block is always called when the surrounding try is done
with, whether the try body threw an exception or returned normally.

> (Also, why is the close in the finally block saying
> "clojure.core/close" when I macroexpand?)

It's just a symbol, and all non-gensym symbols in syntax quote get
namespaced. It doesn't screw up Java interop calls, though, because
only the name part of the symbol is used; not the namespace part:

user=> (. System/out foo.bar/println "foo")
foo
nil
user=>

It looks a little quirky in macroexpand output and seems slightly ugly
but it works and probably isn't even inefficient at runtime, as the
close symbol presumably has a name slot that takes up four bytes
whether it's nil or a pointer to a string, and the "clojure.core"
string value will be an interned string that has other references
anyway.

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