Re: ANN: clojure.contrib.error-kit

2009-02-15 Thread Chouser
On Sun, Feb 15, 2009 at 10:50 PM, David Nolen wrote: > Would it be possible to make the arguments to handle be optional? Is this a > good or bad idea? (kit/with-handler (vec (map int-half [2 4 5 8])) (kit/handle *odd-number-error* [n] (throw (Exception. (format "Odd number %d in vector."

Re: ANN: clojure.contrib.error-kit

2009-02-15 Thread David Nolen
Would it be possible to make the arguments to handle be optional? Is this a good or bad idea? It seems to me, in the case of setting up test fixtures that check for raised errors, often you don't care what arguments the error takes. David On Fri, Feb 6, 2009 at 9:10 PM, Chouser wrote: > (kit/

Re: ANN: clojure.contrib.error-kit

2009-02-08 Thread Chouser
On Sun, Feb 8, 2009 at 9:24 AM, Meikel Brandmeyer wrote: > Hi, > > Am 08.02.2009 um 14:31 schrieb Chouser: > >> (deferror *foo* [*bar*] "Foo Error" [arg1]) >> (deferror *foo* "Foo Error" [*bar*] [arg1]) ; oops > > A question w/o looking at the actual implementation > code or further thinking abou

Re: ANN: clojure.contrib.error-kit

2009-02-08 Thread Meikel Brandmeyer
Hi, Am 08.02.2009 um 14:31 schrieb Chouser: (deferror *foo* [*bar*] "Foo Error" [arg1]) (deferror *foo* "Foo Error" [*bar*] [arg1]) ; oops A question w/o looking at the actual implementation code or further thinking about possible issues: Is there a reason why not to place the docstring as i

Re: ANN: clojure.contrib.error-kit

2009-02-08 Thread Chouser
On Sun, Feb 8, 2009 at 5:18 AM, David Nolen wrote: > > Sweet! I'm glad it's working for you, and that you have figured out how to use it despite the almost complete lack of docs. :-P > That said I do have one minor annoyance and that is the need to leave an > empty bracket if you want to creat

Re: ANN: clojure.contrib.error-kit

2009-02-08 Thread David Nolen
So far this is fantastic! And I haven't even got around to playing with the restart mechanism :) I'm using it in Spinoza to provide contextual errors (malformed slot list, missing base class etc.). I notice the contrib libraries in general are very good at throwing exceptions so that consumers hav

Re: ANN: clojure.contrib.error-kit

2009-02-07 Thread David Nolen
Nice I will most definitely be checking this out and get back with thoughts. I've been fearing the need to define custom Java Exception for my code and this looks most useful for people who wish to code as much as possible in pure Clojure. On Fri, Feb 6, 2009 at 9:10 PM, Chouser wrote: > > It's

ANN: clojure.contrib.error-kit

2009-02-06 Thread Chouser
It's not currently possible to define new Java Exceptions without ahead-of-time compilation, which is sometimes inconvenient. Besides this, Java's try/catch exception system isn't as flexible as, for example, Common Lisp's condition/restart system. To address both these concerns, I've added a li