guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

throw.c


From: Dirk Herrmann
Subject: throw.c
Date: Wed, 6 Sep 2000 14:39:49 +0200 (MEST)

Hello Marius and everybody on the list.

Because of the GCSE problem I tried to understand the code in
throw.c.  Thus, the following question:

  /* If we didn't find anything, print a message and abort the process
     right here.  If you don't want this, establish a catch-all around
     any code that might throw up. */
  if (SCM_NULLP (winds) || SCM_FALSEP (dynpair))
    {
      scm_handle_by_message (NULL, key, args);
      abort ();
    }

Is it at all possible that dynpair is #f, or could this test be
eliminated?  Further, scm_handle_by_message never returns, which means we
could get rid of the call to abort.  Unfortunately, the name
scm_handle_by_message doesn't indicate that the function will always
terminate the application.  We should think of a better name.  Since the
function is only used within throw.c and has the very special purpose to
handle uncaught exceptions, we could make it static and call it, for
example, handle_uncaught_and_exit.

This, however, does not mean that we could not provide a _distinct_
function scm_handle_by_message_and_exit for user convenience.  But, the
current functionality of scm_handle_by_message seems not appropriate for a
function to provide for the user because of the special treatment of
'quit:  This seems to be too specialized for me to be of general use.  In
any case, even if a similar function (with or without special 'quit
treatment) is to be provided for the user, the name should reflect that it
always terminates.  Otherwise everybody using it will have to add a
comment or will have to add a bogus abort(), in order to explain what
happens.

Best regards,
Dirk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]