A problem in scripting Snow

From: Shiro Kawai <shiro_at_lava.net>
Date: Mon, 27 Mar 2000 01:51:20 -1000

This is a matter of design, and I hope the solution will be found
by the next release.

In current version of snow, when it is used as an executable script
(#!-magic of the shell) and encounters an error without an
error handler, it prints out the error message, then _goes_to_repl_loop_.

I use snow as an engine of Scheme scripting at work, and this
behavior is inconvenient since it mistifies the users of my script,
most of whom are not programmers.

If the application uses GUI by STk, it is OK since
the users can still kill the application through menus.
If it is a shell script, however, the users just think the script
hangs.

It is solved by setting my own report-error procedure to make
the program exit after printing the error message. However, if I
do so, it is inconvenient for me to debug my script interactively,
since every time I hit the error the Scheme session exits.

My ideas are either one of followings. Any ideas?

 * In repl_driver() of toplevel.c, let snow die when it encounters
   an error in the non-interactive mode (add something like this
   before the call to repl_loop())
   
    if (STk_interactivep && STk_snow_is_running)
       STk_quit_interpreter(UNBOUND);

 * Add a Scheme function INTERACTIVE? which reflects the C variable
   STk_interactivep. The script can test this variable and install
   the error handler only if it's in non-interactive use.

--
Shiro Kawai
  Programmer, or an inline hockey lover         http://www.lava.net/~shiro
# The most important things are the hardest things to say --- Stephen King
Received on Mon Mar 27 2000 - 13:51:34 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST