@comment The title is printed in a large font.
@title Guile Reference Manual
@subtitle Edition @value{MANUAL-EDITION}, for use with Guile @value{VERSION}
-@c @subtitle $Id: guile.texi,v 1.43 2005-04-18 22:29:42 kryde Exp $
+@c @subtitle $Id: guile.texi,v 1.44 2005-06-22 23:42:23 kryde Exp $
@c See preface.texi for the list of authors
@author The Guile Developers
The @ref{Programming Overview} section of this part contains general
musings and guidelines about programming with Guile. It explores
-different ways to design aprogram around Guile, or how to embed Guile
+different ways to design a program around Guile, or how to embed Guile
into existing programs.
There is also a pedagogical yet detailed explanation of how the data
The one exception is that you can directly assign a @code{SCM} value to
a @code{SCM} variable by using the C @code{=} operator.
-The following (contrieved) example shows how to do it right. It
+The following (contrived) example shows how to do it right. It
implements a function of two arguments (@var{a} and @var{flag}) that
returns @var{a}+1 if @var{flag} is true, else it returns @var{a}
unchanged.
by any active Scheme values. This activity is called @dfn{garbage
collection}.
-It is easy for Guile to remember all blocks of memory that is has
+It is easy for Guile to remember all blocks of memory that it has
allocated for use by Scheme values, but you need to help it with finding
all Scheme values that are in use by C code.
potential references to @code{SCM} objects and considers all referenced
objects to be alive. The scanning considers each and every word of the
stack, regardless of what it is actually used for, and then decides
-whether it could possible be a reference to a @code{SCM} object. Thus,
+whether it could possibly be a reference to a @code{SCM} object. Thus,
the scanning is guaranteed to find all actual references, but it might
also find words that only accidentally look like references. These
`false positives' might keep @code{SCM} objects alive that would
This approach is theoretically very powerful since it is easier to
reason formally about recursion than about gotos. In C, using
-recursion exclusively would not be practical, tho, since it would eat
+recursion exclusively would not be practical, though, since it would eat
up the stack very quickly. In Scheme, however, it is practical:
function calls that appear in a @dfn{tail position} do not use any
additional stack space (@pxref{Tail Calls}).
immediately returned from the calling function. In the following
example, the call to @code{bar-1} is in a tail position, while the
call to @code{bar-2} is not. (The call to @code{1-} in @code{foo-2}
-is in a tail position, tho.)
+is in a tail position, though.)
@lisp
(define (foo-1 x)
(@pxref{Frames}).
Instead of coping with non-local control flow, you can also prevent it
-by errecting a @emph{continuation barrier}, @xref{Continuation
+by erecting a @emph{continuation barrier}, @xref{Continuation
Barriers}. The function @code{scm_c_with_continuation_barrier}, for
example, is guaranteed to return exactly once.
returned from @code{my_list_to_vector}.)
Of course the behavior of @code{my_list_to_vector} is suboptimal when
-@var{list} does indeed gets asynchronously lengthened or shortened in
+@var{list} does indeed get asynchronously lengthened or shortened in
another thread. But it is robust: it will always return a valid vector.
That vector might be shorter than expected, or its last elements might
be unspecified, but it is a valid vector and if a program wants to rule
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
A shared library can be loaded into a running Guile process with the
function @code{load-extension}. In addition to the name of the
-library to load, this function also expects the name of function from
+library to load, this function also expects the name of a function from
that library that will be called to initialize it. For our example,
we are going to call the function @code{init_bessel} which will make
@code{j0_wrapper} available to Scheme programs with the name
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
using Autoconf with Guile. Guile also provides the @code{GUILE_FLAGS}
macro for autoconf that performs all necessary checks. Here is a
@file{configure.in} file for @code{simple-guile} that uses this macro.
-Autoconf can use as this file as template to generate a @code{configure}
+Autoconf can use this file as a template to generate a @code{configure}
script. In order for Autoconf to find the @code{GUILE_FLAGS} macro, you
will need to run @code{aclocal} first. This is not really Guile
specific, so you should refer to the Autoconf documentation REFFIXME
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
There can only be at most 256 different smob types in the system.
Instead of registering a huge number of smob types (for example, one
for each relevant C struct in your application), it is sometimes
-better to register just one and implement a second alyer of type
+better to register just one and implement a second layer of type
dispatching on top of it. This second layer might use the 16 extra
-bits for as an extended type, for example.
+bits to extend its type, for example.
Here is how one might declare and register a new type representing
eight-bit gray-scale images: