This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[bug] format in script


Hi,

Scheme-version format (in the CVS guile) doesn't work in script mode:

$ cat test-format
#!/usr/local/bin/guile -s
!#
(use-modules (ice-9 format))
(format #t "~A ~a\n" "REPLACED" "replaced")
$ ./test-format
REPLACED ~a
$ 

And the following patch seems to fix it (why?):

Index: ice-9/format.scm
===================================================================
RCS file: /cvs/guile/guile/guile-core/ice-9/format.scm,v
retrieving revision 1.3
diff -u -r1.3 format.scm
--- format.scm	1999/09/11 17:51:09	1.3
+++ format.scm	2000/01/17 06:12:46
@@ -1670,7 +1670,8 @@
 
 (define format:abort (lambda () (error "error in format")))
 
-(define format format:format)
+;(define format format:format)
+(variable-set! (builtin-variable 'format) format:format)
 
 ;; If this is not possible then a continuation is used to recover
 ;; properly from a format error. In this case format returns #f.
------------

regards,
-- 
narazaki

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]