Re: Creating custom exceptions in clojure gen--class use?

2009-11-02 Thread Meikel Brandmeyer
Hi, Am 02.11.2009 um 03:05 schrieb Kevin Downey: it'd be nice if clojure came with an Exception class that extended IMeta so you could use (catch MetaException e (if (= :my-exception (type e)) do-stuff (throw e))) Isn't that, what c.c.condidtion does? gen-class is what you are looking for.

Re: Creating custom exceptions in clojure gen--class use?

2009-11-02 Thread Teemu Antti-Poika
On Nov 1, 11:18 pm, John Harrop jharrop...@gmail.com wrote: On Sun, Nov 1, 2009 at 3:47 PM, Teemu Antti-Poika antti...@gmail.comwrote: I want to use my own exceptions to control program flow. That's usually not a very good idea. What exactly are you trying to do, for which this would be

Re: Creating custom exceptions in clojure gen--class use?

2009-11-02 Thread John Harrop
On Mon, Nov 2, 2009 at 10:00 AM, Teemu Antti-Poika antti...@gmail.comwrote: On Nov 1, 11:18 pm, John Harrop jharrop...@gmail.com wrote: On Sun, Nov 1, 2009 at 3:47 PM, Teemu Antti-Poika antti...@gmail.com wrote: I want to use my own exceptions to control program flow. That's usually

Re: Creating custom exceptions in clojure gen--class use?

2009-11-02 Thread Teemu Antti-Poika
On Nov 2, 7:12 pm, John Harrop jharrop...@gmail.com wrote: On Mon, Nov 2, 2009 at 10:00 AM, Teemu Antti-Poika antti...@gmail.comwrote: I expressed myself poorly: what I meant was simply that I want to use exceptions to handle some error situations but leave some exceptions for the servlet

Creating custom exceptions in clojure gen--class use?

2009-11-01 Thread Teemu Antti-Poika
Hi folks, greetings from a beginning clojurian! Below a dilemma I noticed recently. I think/hope I've missed something, since what I am trying to do does not sound too exotic. Any clues are appreciated! I want to use my own exceptions to control program flow. I want to catch my own exceptions

Re: Creating custom exceptions in clojure gen--class use?

2009-11-01 Thread pmf
On Nov 1, 8:47 pm, Teemu Antti-Poika antti...@gmail.com wrote: I want to use my own exceptions to control program flow. I want to catch my own exceptions and let the surrounding container worry about other exceptions. In order to do this, I must catch my exceptions selectively by type name,

Re: Creating custom exceptions in clojure gen--class use?

2009-11-01 Thread John Harrop
On Sun, Nov 1, 2009 at 3:47 PM, Teemu Antti-Poika antti...@gmail.comwrote: Hi folks, greetings from a beginning clojurian! Below a dilemma I noticed recently. I think/hope I've missed something, since what I am trying to do does not sound too exotic. Any clues are appreciated! I want to

Re: Creating custom exceptions in clojure gen--class use?

2009-11-01 Thread Meikel Brandmeyer
Hi, Am 01.11.2009 um 20:47 schrieb Teemu Antti-Poika: The only way I have managed to achieve this so far is to pre-compile the class using gen-class and a separate compilation step. While googling for solution I came across the old gen-and-load-class, which seemed to do the trick in the old

Re: Creating custom exceptions in clojure gen--class use?

2009-11-01 Thread Kevin Downey
it'd be nice if clojure came with an Exception class that extended IMeta so you could use (catch MetaException e (if (= :my-exception (type e)) do-stuff (throw e))) On Sun, Nov 1, 2009 at 1:07 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 01.11.2009 um 20:47 schrieb Teemu Antti-Poika:

Re: Creating custom exceptions in clojure gen--class use?

2009-11-01 Thread Richard Newman
it'd be nice if clojure came with an Exception class that extended IMeta so you could use (catch MetaException e (if (= :my-exception (type e)) do-stuff (throw e))) Indeed. A couple of little macros later (catch-type?), and maybe adding additional values into the metadata, and the need for