[plt-scheme] inf.0 and nan.0 in embeded program

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Mar 4 22:02:51 EST 2006

At Sat, 04 Mar 2006 10:02:15 -0700, Chongkai Zhu wrote:
> I think this is more poor, because to call scheme_eval_string, I need to
> do all these things:
> 
>   mz_jmp_buf * volatile save, fresh;
>   ...
>   save = scheme_current_thread->error_buf;
>   scheme_current_thread->error_buf = &fresh;
>   if (scheme_setjmp(scheme_error_buf)) {
>     /* There was an error */
>     scheme_current_thread->error_buf = save;
>     ...
>   } else {
>     v = scheme_eval_string("+inf.0", env);
>     scheme_current_thread->error_buf = save;
>   }

It's not too difficult to abstract over this pattern, even in C.

Also, if you disable breaks, evaluating constant expressions like
"+inf.0" shouldn't lead to any exception or other escape.

Matthew



Posted on the users mailing list.