Well, I found a way to dodge that need. But still interested in whether 
it's possible. Here's my dodge. Ugly and proud.

(defmacro itry
  "If expr results in an exception, prompt the user to retry or give
up. The user can execute arbitrary code somewhere else or fiddle with
a DB before retrying. Returns nil if the user gives up."
  [expr]
  `(loop [result# :success]
     (case result#
       :no nil
       :success (recur 
                 (try ~expr
                      (catch Exception e#
                        (-> (ui/dialog
                             :option-type :yes-no 
                             :content (str "An exception occurred:\n"
                                           e#
                                           "\n\nRetry this step?\n"
                                           '~expr)
                             :title "Retry?")
                            ui/pack! ui/show!))))
       result#)))

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