Generating new exception classes in clojure

2011-08-22 Thread Brian Hurt
OK, I'm not sure if I'm just missing something obvious here, or if there really is no way to do this. What I want to be able to do is to be able to create new exception classes, in the repl, and be able to throw them and catch them. What I want to be able to do is something like: (defexception

Re: Generating new exception classes in clojure

2011-08-22 Thread David Powell
You can use proxy for this. It doesn't create wrappers, it creates a proper subclass with methods that delegate to clojure functions via var lookup. -- Dave -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Generating new exception classes in clojure

2011-08-22 Thread Brian Hurt
How can I catch a proxied Throwable class without catching everything? I suppose I could grab the class and go at it with reflection... Brian On Mon, Aug 22, 2011 at 3:21 PM, David Powell d...@djpowell.net wrote: You can use proxy for this. It doesn't create wrappers, it creates a proper

Re: Generating new exception classes in clojure

2011-08-22 Thread Craig Andera
How can I catch a proxied Throwable class without catching everything?  I suppose I could grab the class and go at it with reflection... I wrestled with this problem for a while, and got to you can't do it. At least, not without AOT compilation of some sort. I did come up with a horrible,

Re: Generating new exception classes in clojure

2011-08-22 Thread Phil Hagelberg
On Mon, Aug 22, 2011 at 11:02 AM, Brian Hurt bhur...@gmail.com wrote: What I want to be able to do is to be able to create new exception classes, in the repl, and be able to throw them and catch them. At the risk of sounding curmudgeonly: are you sure that's what you want? I suspect you really