This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
format & complex numbers.
- To: guile@sourceware.cygnus.com
- Subject: format & complex numbers.
- From: Ceri Storey <cez@nomorespam.freeserve.co.uk>
- Date: Sun, 29 Aug 1999 22:55:34 +0100
There seems to be a small problem with the new (ice-9 format)
module. If I do :
guile> (use-modules (ice-9 format))
guile> (format #t "~I\n" 6+1i)
It complains that it does not support support complex numbers. This is
clearly not right. I guess it must have been an oversight when
'borrowing' from slib. As far is i can tell, it comes down to 'complex
not being provided somewhere, but then I'm no wizard. It works when
using plain slib though [see end].
guile> (display 6+1i)(newline)
6.0+1.0i
guile> (debug-enable 'backtrace)
(stack 20000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 procnames cheap)
guile> (format #t "~I\n" 6+1i)
FORMAT: error with call: (format #t "~I<===
" ===>6.0+1.0i )
complex numbers not supported by this scheme system
Backtrace:
0* [format:format #t "~I
" ...]
1 (let ((args #)) (set! format:args args) ...)
...
2 [format:out #<output: standard output /dev/pts/2> "~I
" ...]
3 (let ((arg-pos #) (arg-len #)) (cond (# # # ...) (# # # ...) ...))
4* [format:format-work "~I
" (6.0+1.0i)]
5 (letrec ((format-string-len #) (arg-pos 0) (arg-len #) ...) (set! format:pos 0) ...)
6* [anychar-dispatch]
7 (if (>= format:pos format-string-len) arg-pos ...)
...
8 (case (char-upcase (next-char)) ((#\A) (set! format:read-proof #) (format:out-obj-padded # # ...) ...) ...)
9* (if (not format:complex-numbers) (format:error "complex numbers not supported by this scheme system"))
10 [format:error "complex numbers not supported by this scheme system"]
11 (let ((error-continuation format:error-continuation) (format-args format:args) (port #)) (set! format:error format:intern-error) ...)
12* [format:abort]
13 (slib:error "error in format")
/usr/local/share/guile/1.3.2/ice-9/format.scm:1671:33: In expression (slib:error "error in format"):
/usr/local/share/guile/1.3.2/ice-9/format.scm:1671:33: Unbound variable: slib:error
ABORT: (misc-error)
guile>
guile> (use-modules (ice-9 slib))
guile> (require 'format)
guile> (provided? 'complex)
#t
guile> (format #t "~I\n" 6+1i)
6.0+1.0i
#t
guile>
--
-----------| Ceri Storey
\|/ | http://www.nomorespam.freeserve.co.uk/
(O O) | {for geek code also}
_o0O(_)O0o_| cez@nomorespam.freeserve.co.uk
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M/S d? s+:-- a--- C++ UL++++ P+ L+++ E W++(--) N+ o? K? O? W--- M-
V? PS+ PE-- Y+ PGP+ t+ 5++ X+ R@ tv++ b+++() DI? D G e@>+++ h! r-- !y+
------END GEEK CODE BLOCK------