From 899a7b3c064eb2008213bcd6581bf1b8fb295927 Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Wed, 12 Jan 2000 01:54:23 +0000 Subject: [PATCH] *** empty log message *** --- NEWS | 44 ++++++++++++++++++++++++++++++++++++++++++++ THANKS | 1 + doc/ChangeLog | 7 +++++++ 3 files changed, 52 insertions(+) diff --git a/NEWS b/NEWS index 5ad15701d..e139d71f8 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,50 @@ primitive `scm-error', now use scm_format to do their work. This means that the message strings of all code must be updated to use ~A where %s was used before, and ~S where %S was used before. +During the period when there still are a lot of old Guiles out there, +you might want to support both old and new versions of Guile. + +There are basically two methods to achieve this. Both methods use +autoconf. Put + + AC_CHECK_FUNCS(scm_simple_format) + +in your configure.in. + +Method 1: Use the string concatenation features of ANSI C's + preprocessor. + +In C: + +#ifdef HAVE_SCM_SIMPLE_FORMAT +#define FMT_S "~S" +#else +#define FMT_S "%S" +#endif + +Then represent each of your error messages using a preprocessor macro: + +#define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!" + +In Scheme: + +(define fmt-s (if (defined? 'simple-format) "~S" "%S")) +(define make-message string-append) + +(define e-spider-error (make-message "There's a spider in your " fmt-s "!!!")) + +Method 2: Use the oldfmt function found in doc/oldfmt.c. + +In C: + +scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"), + ...); + +In Scheme: + +(scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!") + ...) + * Massive software engineering face-lift by Greg J. Badros Now Guile primitives are defined using the GUILE_PROC/GUILE_PROC1 macros diff --git a/THANKS b/THANKS index 1c9b437e0..809e10fe5 100644 --- a/THANKS +++ b/THANKS @@ -13,6 +13,7 @@ Bug reports and fixes: Mark Galassi Greg Harvey Dirk Hermann + Brad Knotwell Eric Moore Roland Orre Bertrand Petit diff --git a/doc/ChangeLog b/doc/ChangeLog index 826ebd9f8..41b795f93 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2000-01-12 Mikael Djurfeldt + + * README: Updated with note about oldfmt.c. + + * oldfmt.c: New file: Used by application writers to adapt to + new-style error format strings. + 1999-12-06 Gary Houston * data-rep.texi: change dircategory to match change in guile-doc