(scm_ithrow): more refined error message: print symbols
authorHan-Wen Nienhuys <hanwen@lilypond.org>
Thu, 18 Jan 2007 12:34:24 +0000 (12:34 +0000)
committerHan-Wen Nienhuys <hanwen@lilypond.org>
Thu, 18 Jan 2007 12:34:24 +0000 (12:34 +0000)
too.

libguile/ChangeLog
libguile/throw.c

index 8d2555d..cec0dda 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-18  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * throw.c (scm_ithrow): more refined error message: print symbols
+       too.
+
 2007-01-16  Kevin Ryde  <user42@zip.com.au>
 
        * feature.c, feature.h (scm_set_program_arguments_scm): New function,
index 86e4d1f..9bffda7 100644 (file)
@@ -711,9 +711,16 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED)
 
       
       for (; scm_is_pair (s); s = scm_cdr (s), i++)
-       if (scm_is_string (scm_car (s)))
-         fprintf (stderr, "argument %d: %s\n", i, scm_i_string_chars (scm_car (s)));
-      
+       {
+         char const *str = NULL;
+         if (scm_is_string (scm_car (s)))
+           str = scm_i_string_chars (scm_car (s));
+         else if (scm_is_symbol (scm_car (s)))
+           str = scm_i_symbol_chars (scm_car (s));
+         
+         if (str != NULL)
+           fprintf (stderr, "argument %d: %s\n", i, str);
+       }
       abort ();
     }