4

I attempted to run a gambit scheme script that was previously run with guile. I noticed that gambit fails because it is missing the "format" function.

Is format not part of scheme?

(format #t "example(~a)=<~a>\n" i (example i))

Instead I modified my gambit script to the following.

(display (string-append "example(" (number->string i) ")=<" (number->string (example i)) ">\n"))

What am I missing here? Thanks.

henninb
  • 133
  • 2
  • 11

1 Answers1

4

In Gambit you can use standard R7RS libraries and you need to import SRFI-28 that contain format function.

(import (srfi 28))

But Scheme format function as defined by SRFI-28 don't have #t argument that print to stdout like Common Lips have. First argument is always output string pattern:

(display (format "example(~a)=<~a>\n" i (example i)))
(newline)
jcubic
  • 61,973
  • 54
  • 229
  • 402