[plt-scheme] Error Checking

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Thu Jun 18 17:21:15 EDT 2009

On Thu, Jun 18, 2009 at 9:49 PM, Jakub Piotr Cłapa<jpc-ml at zenburn.net> wrote:
> On 6/18/09 7:43 PM, Paulo J. Matos wrote:
>>
>> I have tried to look at the
>> definition of raise-user-error in the plt source code but couldn't
>> find anything. Can someone point me to it or correct my design if I
>> could do something simpler?
>
> The raise functions are actually very simple. This is how I do it:
>
> (define-struct (exn:fail:syntax exn:fail) ())
>
> (define (raise-syntax-error msg)
>  (raise (make-exn:fail:syntax msg (current-continuation-marks))))
>
> You would probably like to do something more interesing with msg.
>

Thanks!

> PS. Good exception design is something I am not quite sure how to do in
> Scheme [snip]

Neither do I... I would love to see a good treatment of this topic
since I believe it is a very important issue in production software.

> --
> regards,
> Jakub Piotr Cłapa
>



-- 
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net


Posted on the users mailing list.