On May 29, 2009, at 10:28 AM, Derick Eddington wrote:
If --warnings-fatal makes &ikarus-warning exceptions exit ikarus, that
sounds good. But I don't think it should make &warning exceptions
exit
because those are the users' programs'/libraries' responsibility to
handle because the R6RS semantics is for the base handler to return.
True that it's required that the base handler to return. But
Ikarus's base handler does something different: it prints the
condition *then* returns instead of just returning, right?
So, this might be considered a non-conforming behavior (though
all R6RS implementations that I tested do print the warnings
too).
The default behavior should (I guess) be to print the warning
then return (as it currently is). When the program runs, the
user should be able to intercept the exceptions and do
whatever the user pleases (as they currently can). The
question here is of two parts:
1. about handling warnings that the user *cannot intercept*
(such as ones that happen when libraries are initialized
before the script's body, containing the exception handler,
is executed).
2. about handling warnings that the user *did not raise*
(such as compiler warnings).
Part 2 is not important, I would argue. Ikarus's own warnings
should not receive a more special treatment than a warning
issued by any other library that your program happens to use.
It's better to handle all warnings on equal bases.
Part 1 can be handled in some ways already. For example, one
can write a wrapper script that installs an exception handler
around a ``load-r6rs-script'' of the real script. So, the
user already has total control of the situation which is a
good thing. It's just a little clunky, so, packaging up some
predefined and commonly used handlers as ikarus command-line
options is also a good thing. The three I thought of
originally were (mutually exclusive):
(1) --warnings-silent:
silence all warnings (IIRC printing a warning from a cgi
script would be fatal as far as apache is concerned),
(2) --warnings-to-file:
redirect to file (redirect to /dev/null is kinda like
silence but more clunky), and
(3) --warnings-fatal
But this is not the right way to do it (I like inclusive
options more). I think it should be (using the same names but
with different semantics):
(1) --warnings-fatal
make ikarus exit when a warning propagates to the top,
the default exception handler returns instead of exits.
(2) --warnings-to-file <filename>
makes all warnings go to <filename>, by default,
warnings go to the standard error port.
This gives 4 possibilities (or 6 if you consider redirecting
to /dev/null special) and all of them are useful I think.
Anyways, I have to put this off for a few days, so, it's not
pressing to find immediate solutions.
Aziz,,,