[plt-scheme] embedding with 3m

From: dave (dave at pawfal.org)
Date: Wed Jan 31 19:24:49 EST 2007

On Sun, 2007-01-28 at 06:04 +0800, Matthew Flatt wrote:
> In the "Inside MzScheme" manual, I've added an example that shows the
> CGC embedding ported to 3m. The example will appear in the next
> document build, but I've also appended it to the end of this message.

Thanks! It's a lot easier than looking though the macros :)

> Meanwhile, I have some comments on your current code...
> 
> At Sat, 27 Jan 2007 19:42:35 +0000, dave wrote:
> > void interpret(Scheme_Env *e, char *code)
> > {
> > 	MZ_GC_DECL_REG(0);
> > 	mz_jmp_buf * volatile save, fresh;
> > 	save = scheme_current_thread->error_buf;
> >     	scheme_current_thread->error_buf = &fresh;
> > 	
> > 	if (scheme_setjmp(scheme_error_buf)) 
> > 	{
> > 		scheme_current_thread->error_buf = save;
> > 		exit(-1);
> > 	} 
> > 	else 
> > 	{
> > 		scheme_eval_string_all(code, e, 1);
> > 		scheme_current_thread->error_buf = save;
> > 	}
> > }
> 
> When there's no MZ_GC_REG(), then MZ_GC_DECL_REG() is not needed.

IIRC I needed to add that, otherwise scheme_setjmp wouldn't compile.
Thanks again for the support,

dave



Posted on the users mailing list.