[prev in list] [next in list] [prev in thread] [next in thread] 

List:       racket-users
Subject:    [plt-scheme] scheme_warning in Embedded MzScheme
From:       mflatt () cs ! utah ! edu (Matthew Flatt)
Date:       2006-08-30 12:44:42
Message-ID: 20060830044402.291B1650064 () mail-svr1 ! cs ! utah ! edu
[Download RAW message or body]

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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic