The information here currently corresponds with the Gambit-C version 3.0 of Gambit; we will try to track new versions of Gambit-C as they come out.
In particular, unless you specify otherwise, gsi will differ from our
expectations in two key regards. First, it treats upper- and
lower-case letters as always distinct. (I.e., it is "case
sensitive.") Second, it doesn't allow names to end with a colon
(i.e., the :
character).
In order to turn off these two special behaviors, you can specify the
-:s
option when you run gsi. For more information on
this, see the Gambit documentation.
There is another way you can turn off these two special behaviors,
once gsi
is running. You can evaluate
(set-case-conversion! #t) (set-keywords-allowed! #f)The advantage to this second method is that it can automated, by putting these two expressions into a
gambc.scm
initialization file, which Gambit will automatically load each time it
starts up. (See the Gambit documentation for more on this.) The
initialization file can also load libraries, as described below.
If you'd prefer, you can leave Gambit's normal behavior alone; you'll just need to be aware of this at a few places where the textbook assumes case insensitivity.
random
procedure introduced in chapter 6,
and also used in chapters 11 and 14.
The final one is the object-oriented programming system, used in chapter
14.
Each of these libraries can be downloaded from the web below.
Once you have one of the library files on your system, you can load it
into Gambit using the load
procedure. For example,
you could evaluate (load "random")
to load in the
random library. If the random.scm
file isn't in your
current directory (folder) you might need to specify a pathname, such
as (load "/usr/local/scheme-libraries/random")
or
(load "c:\\scheme\\libraries\\random")
.
You can also put the loads into a gambc.scm
initialization file, which Gambit will automatically load each time it
starts up. (See the Gambit documentation for more on this.)
unix-fungraph.scm
random.scm
random
procedure for use with
chapters 6, 11, and 14.
oops.scm
We list below the affected names, organized into categories and listed within each category in their order of their appearance within the book:
length
list-ref
list-tail
map
reverse
gcd
keyword?
(newline)
newline
procedure to
break output into separate lines. Unfortunately, there are two
different conventions in use by different Scheme systems. One is to
always use newline
at the start of each line of output,
while the other is to always use it at the end of each line. As a
result of this lack of standardization, wherever we positioned the
uses of (newline)
in our programs would result in output
that looked odd on some systems. We've tried in the textbook to make
choices that don't look too horrible on any system, with the result
that the output tends to look sub-optimal on every system. In
particular, there tends to be extra blank lines. If you are working
consistently within Gambit (or any other one system), feel free to
remove or reposition (newline)
as necessary to make the
output look best.
rcross-bb
, are
neither pre-defined nor defined within the library. Instead, their
definitions are in a separate file.
random
procedure introduced in the
chapter, you will need to load a library file into Gambit as described
above.
Also, there is one review problem at the end of this chapter that asks
you to define a procedure with the name time
. This will
not be possible under Gambit, since Gambit reserves that name for a
special form for timing the evaluation of expressions. Use another
name instead.
show
procedure. As with the graphics library for
chapters 1 through 4, we have only made this work on unix-like
systems. This version of show
simply uses the book's
image->eps
procedure to write the image out in
Encapsulated PostScript format, then invokes the publically available
ghostview program to view the file, and finally deletes it.
random
in as
described above.
random
in as described above.