[plt-scheme] with-handlers and mzscheme extensions

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Aug 25 15:33:01 EDT 2004

At Mon, 23 Aug 2004 16:31:02 -0400, "David J. Neu" wrote:
> In mzscheme I can do something like this:
> 
> (define-struct (exn:my-exn  exn) ())
> (define-struct (exn:my-exn:sub-exn  exn:my-exn) ())
> 
> ...
> 
> (let ((e (my-exn "opps" (current-continuation-marks))))
>    (raise e))
> 
> I guess what I'm really looking to do is do the same thing from my
> mzscheme extension.  That is, create my own exception type in the C
> code of the mzscheme extension and then have the ability to raise one
> of these new exceptions from the mzscheme extension.

scheme_raise() is the C version of `raise'.

For structures, theres a family of functions: scheme_make_struct_names(),
scheme_make_struct_values(), and so on. It might be easier to create the
struct functions in Scheme and then call them from C.

Matthew



Posted on the users mailing list.