diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2000-01-12 01:54:23 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 2000-01-12 01:54:23 +0000 |
commit | 899a7b3c064eb2008213bcd6581bf1b8fb295927 (patch) | |
tree | 04e845e387a6032c01a72f5960e120b2a14ee8c0 | |
parent | eb46d7afa05ca03fdef6d8d1039de0cb47fa5832 (diff) | |
download | guile-899a7b3c064eb2008213bcd6581bf1b8fb295927.tar.gz |
*** empty log message ***
-rw-r--r-- | NEWS | 44 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | doc/ChangeLog | 7 |
3 files changed, 52 insertions, 0 deletions
@@ -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 <gjb@cs.washington.edu> Now Guile primitives are defined using the GUILE_PROC/GUILE_PROC1 macros @@ -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 <mdj@mdj.nada.kth.se> + + * 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 <ghouston@freewire.co.uk> * data-rep.texi: change dircategory to match change in guile-doc |