Remove GH and its traces.
[bpt/guile.git] / doc / ref / guile.texi
1 \input texinfo
2 @c -*-texinfo-*-
3 @c %**start of header
4 @setfilename guile.info
5 @settitle Guile Reference Manual
6 @set guile
7 @set MANUAL-EDITION 1.1
8 @c %**end of header
9 @include version.texi
10 @include lib-version.texi
11
12 @copying
13 This reference manual documents Guile, GNU's Ubiquitous Intelligent
14 Language for Extensions. This is edition @value{MANUAL-EDITION}
15 corresponding to Guile @value{VERSION}.
16
17 Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005 Free
18 Software Foundation.
19
20 Permission is granted to copy, distribute and/or modify this document
21 under the terms of the GNU Free Documentation License, Version 1.2 or
22 any later version published by the Free Software Foundation; with the
23 no Invariant Sections, with the Front-Cover Texts being ``A GNU
24 Manual,'' and with the Back-Cover Text ``You are free to copy and
25 modify this GNU Manual.''. A copy of the license is included in the
26 section entitled ``GNU Free Documentation License''.
27 @end copying
28
29
30 @c Notes
31 @c
32 @c We no longer use the category "primitive" to distinguish C-defined
33 @c Scheme procedures from those defined in Scheme. Instead, the
34 @c reference manual now includes a C declaration as well as a Scheme
35 @c declaration for each procedure that is available in both Scheme and
36 @c C.
37 @c
38 @c When adding a new reference entry to the Guile manual, please
39 @c document it with @deffn using one of the following categories:
40 @c
41 @c {Scheme Procedure}
42 @c {Scheme Syntax}
43 @c {C Function}
44 @c {C Macro}
45 @c
46 @c If the entry is for a new primitive, it should have both a @deffn
47 @c {Scheme Procedure} line and a @deffnx {C Function} line; see the
48 @c manual source for plenty of existing examples of this.
49 @c
50 @c For {C Function} entries where the return type and all parameter
51 @c types are SCM, we omit the SCMs. This is easier to read and also
52 @c gets round the problem that Texinfo doesn't allow a @deftypefnx
53 @c inside a @deffn.
54 @c
55 @c For a list of Guile primitives that are not yet incorporated into the
56 @c reference manual, see the file `new-docstrings.texi', which holds all
57 @c the docstrings snarfed from the libguile C sources for primitives
58 @c that are not in the reference manual. If you have worked with some
59 @c of these concepts, implemented them, or just happen to know what they
60 @c do, please write up a little explanation -- it would be a big help.
61 @c Alternatively, if you know of any reason why some of these should
62 @c *not* go in the manual, please let the mailing list
63 @c <guile-devel@gnu.org> know.
64
65 @c Define indices that are used in the Guile Scheme part of the
66 @c reference manual to group stuff according to whether it is R5RS or a
67 @c Guile extension.
68 @defcodeindex rn
69
70 @c vnew - For (some) new items, indicates the Guile version in which
71 @c item first appeared. In future, this could be made to expand to
72 @c something like a "New in Guile 45!" banner.
73 @macro vnew{VERSION}
74 @end macro
75
76
77 @c The following, @le{} and @ge{}, are standard tex directives, given
78 @c definitions for use in non-tex.
79 @c
80 @ifnottex
81 @macro ge
82 >=
83 @end macro
84 @macro le
85 <=
86 @end macro
87 @end ifnottex
88
89 @c @cross{} is a \times symbol in tex, or an "x" in info. In tex it works
90 @c inside or outside $ $.
91 @tex
92 \gdef\cross{\ifmmode\times\else$\times$\fi}
93 @end tex
94 @ifnottex
95 @macro cross
96 x
97 @end macro
98 @end ifnottex
99
100 @c @m{T,N} is $T$ in tex or @math{N} otherwise. This is an easy way to give
101 @c different forms for math in tex and info.
102 @iftex
103 @macro m {T,N}
104 @tex$\T\$@end tex
105 @end macro
106 @end iftex
107 @ifnottex
108 @macro m {T,N}
109 @math{\N\}
110 @end macro
111 @end ifnottex
112
113 @c @nicode{S} is plain S in info, or @code{S} elsewhere. This can be used
114 @c when the quotes that @code{} gives in info aren't wanted, but the
115 @c fontification in tex or html is wanted. @alias is used rather
116 @c than @macro because backslashes don't work properly in an @macro.
117 @ifinfo
118 @alias nicode=asis
119 @end ifinfo
120 @ifnotinfo
121 @alias nicode=code
122 @end ifnotinfo
123
124
125 @c @iftex
126 @c @cropmarks
127 @c @end iftex
128
129 @dircategory The Algorithmic Language Scheme
130 @direntry
131 * Guile Reference: (guile). The Guile reference manual.
132 @end direntry
133
134 @setchapternewpage odd
135
136 @titlepage
137 @sp 10
138 @comment The title is printed in a large font.
139 @title Guile Reference Manual
140 @subtitle Edition @value{MANUAL-EDITION}, for use with Guile @value{VERSION}
141 @c @subtitle $Id: guile.texi,v 1.49 2008-03-19 22:51:23 ossau Exp $
142
143 @c See preface.texi for the list of authors
144 @author The Guile Developers
145
146 @c The following two commands start the copyright page.
147 @page
148 @vskip 0pt plus 1filll
149 @vskip 0pt plus 1filll
150 @insertcopying
151 @end titlepage
152
153 @c @smallbook
154 @finalout
155 @headings double
156
157 @c Where to find Guile examples.
158 @set example-dir doc/examples
159
160 @ifnottex
161 @node Top, Preface, (dir), (dir)
162 @top The Guile Reference Manual
163
164 @insertcopying
165 @sp 1
166 @end ifnottex
167
168 @menu
169
170 * Preface::
171 * Introduction to Guile::
172
173 * Programming in Scheme::
174 * Programming in C::
175
176 * API Reference::
177
178 * Guile Modules::
179
180 * Autoconf Support::
181
182 Appendices
183
184 * Data Representation:: All the details.
185 * GNU Free Documentation License:: The license of this manual.
186
187 Indices
188
189 * Concept Index::
190 * Procedure Index::
191 * Variable Index::
192 * Type Index::
193 * R5RS Index::
194
195 @end menu
196
197 @contents
198
199 @include preface.texi
200
201 @include intro.texi
202
203 @node Programming in Scheme
204 @chapter Programming in Scheme
205
206 Guile's core language is Scheme, and an awful lot can be achieved simply
207 by using Guile to write and run Scheme programs. In this part of the
208 manual, we explain how to use Guile in this mode, and describe the tools
209 that Guile provides to help you with script writing, debugging and
210 packaging your programs for distribution.
211
212 For readers who are not yet familiar with the Scheme language, this part
213 includes a chapter that presents the basic concepts of the language, and
214 gives references to freely available Scheme tutorial material on the
215 web.
216
217 For detailed reference information on the variables, functions
218 etc. that make up Guile's application programming interface (API),
219 @xref{API Reference}.
220
221 @menu
222 * Basic Ideas:: Basic ideas in Scheme.
223 * Guile Scheme:: Guile's implementation of Scheme.
224 * Guile Scripting:: How to write Guile scripts.
225 * Using Guile Interactively:: Guile's REPL features.
226 * Using Guile in Emacs:: Guile and Emacs.
227 * Further Reading:: Where to find out more about Scheme.
228 @end menu
229
230 @include scheme-ideas.texi
231 @include scheme-intro.texi
232 @include scheme-scripts.texi
233 @include scheme-using.texi
234 @include scheme-reading.texi
235
236 @node Programming in C
237 @chapter Programming in C
238
239 This part of the manual explains the general concepts that you need to
240 understand when interfacing to Guile from C. You will learn about how
241 the latent typing of Scheme is embedded into the static typing of C, how
242 the garbage collection of Guile is made available to C code, and how
243 continuations influence the control flow in a C program.
244
245 This knowledge should make it straightforward to add new functions to
246 Guile that can be called from Scheme. Adding new data types is also
247 possible and is done by defining @dfn{smobs}.
248
249 The @ref{Programming Overview} section of this part contains general
250 musings and guidelines about programming with Guile. It explores
251 different ways to design a program around Guile, or how to embed Guile
252 into existing programs.
253
254 There is also a pedagogical yet detailed explanation of how the data
255 representation of Guile is implemented, @xref{Data Representation}.
256 You don't need to know the details given there to use Guile from C,
257 but they are useful when you want to modify Guile itself or when you
258 are just curious about how it is all done.
259
260 For detailed reference information on the variables, functions
261 etc. that make up Guile's application programming interface (API),
262 @xref{API Reference}.
263
264 @menu
265 * Linking Programs With Guile:: More precisely, with the libguile library.
266 * Linking Guile with Libraries:: To extend Guile itself.
267 * General Libguile Concepts:: General concepts for using libguile.
268 * Defining New Types (Smobs):: Adding new types to Guile.
269 * Function Snarfing:: A way to define new functions.
270 * Programming Overview:: An overview of Guile programming.
271 @end menu
272
273 @include libguile-linking.texi
274 @include libguile-extensions.texi
275 @include libguile-concepts.texi
276 @include libguile-smobs.texi
277 @include libguile-snarf.texi
278 @include libguile-program.texi
279
280 @node API Reference
281 @chapter API Reference
282
283 Guile provides an application programming interface (@dfn{API}) to
284 developers in two core languages: Scheme and C. This part of the manual
285 contains reference documentation for all of the functionality that is
286 available through both Scheme and C interfaces.
287
288 @menu
289 * API Overview:: Overview of the Guile API.
290 * The SCM Type:: The fundamental data type for C code.
291 * Initialization:: Initializing Guile.
292 * Snarfing Macros:: Macros for snarfing initialization actions.
293 * Simple Data Types:: Numbers, strings, booleans and so on.
294 * Compound Data Types:: Data types for holding other data.
295 * Smobs:: Defining new data types in C.
296 * Procedures and Macros:: Procedures and macros.
297 * Utility Functions:: General utility functions.
298 * Binding Constructs:: Definitions and variable bindings.
299 * Control Mechanisms:: Controlling the flow of program execution.
300 * Input and Output:: Ports, reading and writing.
301 * Read/Load/Eval:: Reading and evaluating Scheme code.
302 * Memory Management:: Memory management and garbage collection.
303 * Objects:: Low level object orientation support.
304 * Modules:: Designing reusable code libraries.
305 * Scheduling:: Threads, mutexes, asyncs and dynamic roots.
306 * Options and Config:: Configuration, features and runtime options.
307 * Translation:: Support for translating other languages.
308 * Internationalization:: Support for gettext, etc.
309 * Debugging:: Debugging infrastructure and Scheme interface.
310 @end menu
311
312 @include api-overview.texi
313 @include api-scm.texi
314 @include api-init.texi
315 @include api-snarf.texi
316 @include api-data.texi
317 @include api-compound.texi
318 @include api-smobs.texi
319 @include api-procedures.texi
320 @include api-utility.texi
321 @include api-binding.texi
322 @include api-control.texi
323 @include api-io.texi
324 @include api-evaluation.texi
325 @include api-memory.texi
326 @include api-modules.texi
327 @include api-scheduling.texi
328 @c object orientation support here
329 @include api-options.texi
330 @include api-translation.texi
331 @include api-i18n.texi
332 @include api-debug.texi
333
334 @node Guile Modules
335 @chapter Guile Modules
336
337 @menu
338 * SLIB:: Using the SLIB Scheme library.
339 * POSIX:: POSIX system calls and networking.
340 * getopt-long:: Command line handling.
341 * SRFI Support:: Support for various SRFIs.
342 * Readline Support:: Module for using the readline library.
343 * Value History:: Maintaining a value history in the REPL.
344 * Pretty Printing:: Nicely formatting Scheme objects for output.
345 * Formatted Output:: The @code{format} procedure.
346 * File Tree Walk:: Traversing the file system.
347 * Queues:: First-in first-out queuing.
348 * Streams:: Sequences of values.
349 * Buffered Input:: Ports made from a reader function.
350 * Expect:: Controlling interactive programs with Guile.
351 * The Scheme shell (scsh):: Using scsh interfaces in Guile.
352 * Tracing:: Tracing program execution.
353 @end menu
354
355 @include slib.texi
356 @include posix.texi
357 @include mod-getopt-long.texi
358 @include srfi-modules.texi
359 @include repl-modules.texi
360 @include misc-modules.texi
361 @include expect.texi
362 @include scsh.texi
363 @include scheme-debugging.texi
364
365 @include autoconf.texi
366
367 @include data-rep.texi
368 @include fdl.texi
369
370 @iftex
371 @page
372 @unnumbered{Indices}
373 @end iftex
374
375 @include indices.texi
376 @include scheme-indices.texi
377
378 @bye