[plt-scheme] scheme_warning in Embedded MzScheme

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Aug 30 00:44:42 EDT 2006

At Tue, 29 Aug 2006 22:05:28 -0600, "Chongkai Zhu" wrote:
> In my C program that embedding MzScheme, calling "scheme_warning" doesn't has 
> any effects.
> 
> I do set scheme_make_stdout/scheme_make_stderr/scheme_make_stdin in my 
> program. They all work fine if I use them by calling 
> scheme_eval/scheme_eval_string. I also checked the source code of 
> "scheme_warning", which should output to the stderr port. But if I call 
> "scheme_warning" directly in C, the function just returns without any effect.
> 
> Would anyone (Matthew?) please explain? Or if it is a feature (although it 
> doesn't sees natural to me), because everything are in C, I can call the C 
> function that implements the port insteady of "scheme_warning".

I'm not sure why it doesn't work. I added a call to scheme_warning() in
MzScheme to check, and the output goes where it's supposed to,
including the GUI-window stderr when MrEd is started without a stderr.
And, like you, I don't see a problem with the implementation of
scheme_warning().

It's definitely better to use scheme_warning(). I expect to change
MzScheme's compiler so that it generates warnings (e.g., when a
function call obviously uses the wrong number of arguments). I'm not
yet sure where those warnings will go --- probably not stderr by
default --- but scheme_warning() output will go to the same place.

Matthew



Posted on the users mailing list.