[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11293: format and simple-format confused after compiling

From: Aleix Conchillo Flaqué
Subject: bug#11293: format and simple-format confused after compiling
Date: Fri, 20 Apr 2012 23:43:46 -0700


today I just got a weird issue (probably my fault). I'm trying to
write a very basic Guile cookbook for beginners, which is the ony
think I know in any case.

Anyway, I have this script:

#!/usr/bin/guile -s

(simple-format #t "my first message with a new line~%")

(format #t "my first ~a message with a number ~d and a new line~%"
           "formatted" 1)

If you execute it for the first time (or after being edited) it
returns the right thing:

;;; note: source file /home/aleix/src/guile/guile-cookbook/recipe-3/recipe-3.scm
;;;       newer than compiled
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/aleix/src/guile/guile-cookbook/recipe-3/recipe-3.scm
;;; compiled 
my first message with a new line
my first formatted message with a number 1 and a new line

However, if I execute it a second time without modifying the file I get:

my first message with a new line
my first formattedBacktrace:
In ice-9/boot-9.scm:
 157: 7 [catch #t #<catch-closure 1aee9c0> ...]
In unknown file:
   ?: 6 [apply-smob/1 #<catch-closure 1aee9c0>]
In ice-9/boot-9.scm:
  63: 5 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 407: 4 [eval # #]
In ice-9/boot-9.scm:
2189: 3 [save-module-excursion #<procedure 1aed340 at
ice-9/boot-9.scm:3724:3 ()>]
3731: 2 [#<procedure 1aed340 at ice-9/boot-9.scm:3724:3 ()>]
In unknown file:
   ?: 1 [load-compiled/vm
   ?: 0 [simple-format #t ...]

ERROR: In procedure simple-format:
ERROR: In procedure simple-format: FORMAT: Unsupported format option
~d - use (ice-9 format) instead

It seems to me that simple-format is saved in the compiled file,
instead of format.

Is this normal? Did I do anything wrong? The other question I had is
that I did not include "(use-modules (ice-9 format))" and it seems
included by default:

Enter `,help' for help.
scheme@(guile-user)> format
$1 = #<procedure 26aaae0 at ice-9/format.scm:1612:9 (destination
format-string . args) | (deprecated-format-string-only)>

I'm running



reply via email to

[Prev in Thread] Current Thread [Next in Thread]