On Tue, Aug 16, 2011 at 3:36 PM, rakesh <[email protected]> wrote:
> In java the finally block is executed after the catch block. But in
> clojure, I observed that the finally block is executed before catch
> block. Is this behavior right.

The behavior is correct. What you are probably seeing is that the side
effect of the finally block is showing up *before* the expression
completes.

Example:

(try (Integer/parseInt "hi") (catch Exception e "catch") (finally
(println "finally"))
;=> finally"catch"

This is because "catch" is returned *after* the finally executes.

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

Reply via email to