Re: reporting function inputs as part of exceptions

2012-09-04 Thread Jim - FooBar();
You want this on every single fn you define? in this case, yes you would need a tweaked 'defn' form...something like this perhaps: (defmacro defn-capt [name [& args] & code] `(defn ~name [~@args] (try ~@code (catch Exception e# {:exception e# :origin ~name

Re: reporting function inputs as part of exceptions

2012-09-04 Thread Jim - FooBar();
I'm so sorry... this one works! (defmacro capture-inputs [f & args] `(try (~f ~@args) (catch Exception e# (do (println "oops!") {:e e# :inputs (vector ~@args)} Jim On 04/09/12 12:23, Jim - FooBar(); wrote: oops gensym mistake! (defmacro capture-inputs [f & args] `(try (apply ~f ~@ar

Re: reporting function inputs as part of exceptions

2012-09-04 Thread Jim - FooBar();
oops gensym mistake! (defmacro capture-inputs [f & args] `(try (apply ~f ~@args) (catch Exception e# (do (println "oops!") {:e e# :inputs (vec ~args)} Jim On 04/09/12 12:20, Jim - FooBar(); wrote: you want the exception thrown to report the arguments or 'capture them' (as you say)

Re: reporting function inputs as part of exceptions

2012-09-04 Thread Jim - FooBar();
you want the exception thrown to report the arguments or 'capture them' (as you say) in the actual Exception object so you can use them outside the try-catch scope? the former is very straight forward you just use your arguments...the latter is more fuss as you have to gen-class your own except

Re: reporting function inputs as part of exceptions

2012-09-03 Thread Alan Malloy
Slingshot's throw+ generates an exception object that includes, among other things, all the locals in the context of your throw. On Monday, September 3, 2012 9:03:42 PM UTC-7, Timothy Pratley wrote: > > I'm working on a project where it would be quite convenient to have the > input values to the