mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 14:30:34 +02:00
*** empty log message ***
This commit is contained in:
parent
eb46d7afa0
commit
899a7b3c06
3 changed files with 52 additions and 0 deletions
44
NEWS
44
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 <gjb@cs.washington.edu>
|
||||
|
||||
Now Guile primitives are defined using the GUILE_PROC/GUILE_PROC1 macros
|
||||
|
|
1
THANKS
1
THANKS
|
@ -13,6 +13,7 @@ Bug reports and fixes:
|
|||
Mark Galassi
|
||||
Greg Harvey
|
||||
Dirk Hermann
|
||||
Brad Knotwell
|
||||
Eric Moore
|
||||
Roland Orre
|
||||
Bertrand Petit
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue