Re: Exception handling functional style

2010-01-30 Thread Peter Schuller
> I am trying to figure out some systematic and clear way how to handle > exceptions in clojure and their bubbling up through the call chain. > Let me illustrate it on some code examples (not executable, just to show the > principle). One response touched on it briefly, but I'm not sure what probl

Re: Exception handling functional style

2010-01-30 Thread Lukas Lehner
This is second reply suggesting monads (the more the better). Do you have any sources or examples (smaller the better) of the same problem in a monadic and non-monadic way? Thanks Lukas On 1/30/2010 7:21 AM, Konrad Hinsen wrote: Lukas Lehner a écrit : Now, imagine the chain of calling functi

Re: Exception handling functional style

2010-01-29 Thread Konrad Hinsen
Lukas Lehner a écrit : Now, imagine the chain of calling functions is relatively big. Here it can all fall down on access-external-source causing an exception, but further up, maybe the message is scrambled, or pretty much anything. The question is, wrapping all function in try - catch does n

Re: Exception handling functional style

2010-01-29 Thread Meikel Brandmeyer
Hi, Am 29.01.2010 um 22:12 schrieb Lukas Lehner: > So, if they (monads) truly solve this kind of problems, then it's time to go > back to study... Maybe you also want to have a look at error-kit. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "C

Re: Exception handling functional style

2010-01-29 Thread Lukas Lehner
Monads, I knew I cannot avoid them after all. I've tried digging into the two main clojure-monad tutorials but got kinda lost, repeatedly. So, if they (monads) truly solve this kind of problems, then it's time to go back to study... Thanks On 1/29/2010 7:49 PM, Raoul Duke wrote: On Fri, Ja

Re: Exception handling functional style

2010-01-29 Thread ataggart
On Jan 29, 4:24 am, Lukas Lehner wrote: > The question is, wrapping all function in try - catch does not make is > clearer (from a processing point of view). Returning nil from broken > functions just adds a boilerplate code all the way up. In my opinion one should only catch those exceptions

Re: Exception handling functional style

2010-01-29 Thread Raoul Duke
On Fri, Jan 29, 2010 at 4:24 AM, Lukas Lehner wrote: > The question is, wrapping all function in try - catch does not make is > clearer (from a processing point of view). Returning nil from broken > functions just adds a boilerplate code all the way up. > > I could not find any guidelines of syste

Exception handling functional style

2010-01-29 Thread Lukas Lehner
Hi all I am trying to figure out some systematic and clear way how to handle exceptions in clojure and their bubbling up through the call chain. Let me illustrate it on some code examples (not executable, just to show the principle). (defn get-from-io [p] (access-external-source p)) (de