Commit | Line | Data |
---|---|---|
38a93523 NJ |
1 | \input texinfo |
2 | @c -*-texinfo-*- | |
3 | @c %**start of header | |
4 | @setfilename guile.info | |
5 | @settitle Guile Reference Manual | |
370babab | 6 | @set guile |
c73543af | 7 | @set MANUAL-EDITION 1.1 |
38a93523 | 8 | @c %**end of header |
d3830c6b KR |
9 | @include version.texi |
10 | ||
11 | @copying | |
12 | This reference manual documents Guile, GNU's Ubiquitous Intelligent | |
13 | Language for Extensions, manual edition @value{MANUAL-EDITION} | |
14 | corresponding to Guile @value{VERSION}. | |
15 | ||
c6ae9c77 | 16 | Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004 Free Software |
5ad1686a | 17 | Foundation. |
d3830c6b | 18 | |
c6ae9c77 MV |
19 | Permission is granted to copy, distribute and/or modify this |
20 | document under the terms of the GNU Free Documentation License, | |
21 | Version 1.2 or any later version published by the Free Software | |
22 | Foundation; with the no Invariant Sections, with the Front-Cover | |
23 | Texts being ``A GNU Manual,'' and with the Back-Cover Texts as in | |
24 | (a) below. A copy of the license is included in the section | |
25 | entitled "GNU Free Documentation License". | |
d3830c6b | 26 | |
c6ae9c77 MV |
27 | (a) The FSF's Back-Cover Text is: ``You are free to copy and modify |
28 | this GNU Manual.'' | |
d3830c6b KR |
29 | @end copying |
30 | ||
38a93523 | 31 | |
2a946b44 | 32 | @c Notes |
370babab | 33 | @c |
2a946b44 NJ |
34 | @c We no longer use the category "primitive" to distinguish C-defined |
35 | @c Scheme procedures from those defined in Scheme. Instead, the | |
36 | @c reference manual now includes a C declaration as well as a Scheme | |
37 | @c declaration for each procedure that is available in both Scheme and | |
38 | @c C. | |
370babab | 39 | @c |
2a946b44 NJ |
40 | @c When adding a new reference entry to the Guile manual, please |
41 | @c document it with @deffn using one of the following categories: | |
42 | @c | |
43 | @c {Scheme Procedure} | |
44 | @c {Scheme Syntax} | |
45 | @c {C Function} | |
46 | @c {C Macro} | |
47 | @c | |
48 | @c If the entry is for a new primitive, it should have both a @deffn | |
49 | @c {Scheme Procedure} line and a @deffnx {C Function} line; see the | |
50 | @c manual source for plenty of existing examples of this. | |
51 | @c | |
52 | @c For {C Function} entries where the return type and all parameter | |
53 | @c types are SCM, we omit the SCMs. This is easier to read and also | |
54 | @c gets round the problem that Texinfo doesn't allow a @deftypefnx | |
55 | @c inside a @deffn. | |
38a93523 | 56 | @c |
370babab NJ |
57 | @c For a list of Guile primitives that are not yet incorporated into the |
58 | @c reference manual, see the file `new-docstrings.texi', which holds all | |
59 | @c the docstrings snarfed from the libguile C sources for primitives | |
60 | @c that are not in the reference manual. If you have worked with some | |
61 | @c of these concepts, implemented them, or just happen to know what they | |
62 | @c do, please write up a little explanation -- it would be a big help. | |
2a946b44 NJ |
63 | @c Alternatively, if you know of any reason why some of these should |
64 | @c *not* go in the manual, please let the mailing list | |
65 | @c <guile-devel@gnu.org> know. | |
38a93523 NJ |
66 | |
67 | @c Define indices that are used in the Guile Scheme part of the | |
68 | @c reference manual to group stuff according to whether it is R5RS or a | |
69 | @c Guile extension. | |
5c4b24e1 | 70 | @defcodeindex rn |
38a93523 | 71 | |
0624ce33 NJ |
72 | @c vnew - For (some) new items, indicates the Guile version in which |
73 | @c item first appeared. In future, this could be made to expand to | |
74 | @c something like a "New in Guile 45!" banner. | |
198586ed NJ |
75 | @macro vnew{VERSION} |
76 | @end macro | |
77 | ||
20685804 | 78 | |
27281a53 KR |
79 | @c @cross{} is a \times symbol in tex, or an "x" in info. In tex it works |
80 | @c inside or outside $ $. | |
81 | @tex | |
82 | \gdef\cross{\ifmmode\times\else$\times$\fi} | |
83 | @end tex | |
84 | @ifnottex | |
85 | @macro cross | |
86 | x | |
87 | @end macro | |
88 | @end ifnottex | |
89 | ||
d6f53bd5 KR |
90 | @c @m{T,N} is $T$ in tex or @math{N} otherwise. This is an easy way to give |
91 | @c different forms for math in tex and info. | |
92 | @iftex | |
93 | @macro m {T,N} | |
94 | @tex$\T\$@end tex | |
95 | @end macro | |
96 | @end iftex | |
97 | @ifnottex | |
98 | @macro m {T,N} | |
99 | @math{\N\} | |
100 | @end macro | |
101 | @end ifnottex | |
102 | ||
20685804 KR |
103 | @c @nicode{S} is plain S in info, or @code{S} elsewhere. This can be |
104 | @c used when the quotes that @code{} gives in info aren't wanted, but | |
105 | @c the fontification in tex or html is wanted. | |
106 | @ifinfo | |
107 | @macro nicode {S} | |
108 | \S\ | |
109 | @end macro | |
110 | @end ifinfo | |
111 | @ifnotinfo | |
112 | @macro nicode {S} | |
113 | @code{\S\} | |
114 | @end macro | |
115 | @end ifnotinfo | |
116 | ||
117 | ||
38a93523 NJ |
118 | @c @iftex |
119 | @c @cropmarks | |
120 | @c @end iftex | |
121 | ||
122 | @dircategory The Algorithmic Language Scheme | |
123 | @direntry | |
c16da59f | 124 | * Guile Reference: (guile). The Guile reference manual. |
38a93523 NJ |
125 | @end direntry |
126 | ||
127 | @setchapternewpage off | |
128 | ||
38a93523 NJ |
129 | @titlepage |
130 | @sp 10 | |
131 | @comment The title is printed in a large font. | |
132 | @title Guile Reference Manual | |
c73543af | 133 | @subtitle Edition @value{MANUAL-EDITION}, for use with Guile @value{VERSION} |
27281a53 | 134 | @subtitle $Id: guile.texi,v 1.28 2004-02-12 00:21:26 kryde Exp $ |
b45898ca NJ |
135 | |
136 | @c AUTHORS | |
137 | ||
138 | @c The Guile reference and tutorial manuals were written and edited | |
139 | @c largely by Mark Galassi and Jim Blandy. In particular, Jim wrote the | |
140 | @c original tutorial on Guile's data representation and the C API for | |
141 | @c accessing Guile objects. | |
142 | ||
143 | @c Significant portions were contributed by Gary Houston (contributions | |
85a9b4ed | 144 | @c to POSIX system calls and networking, expect, I/O internals and |
b45898ca NJ |
145 | @c extensions, slib installation, error handling) and Tim Pierce |
146 | @c (sections on script interpreter triggers, alists, function tracing). | |
147 | ||
148 | @c Tom Lord contributed a great deal of material with early Guile | |
149 | @c snapshots; although most of this text has been rewritten, all of it | |
150 | @c was important, and some of the structure remains. | |
151 | ||
152 | @c Aubrey Jaffer wrote the SCM Scheme implementation and manual upon | |
153 | @c which the Guile program and manual are based. Some portions of the | |
154 | @c SCM and SLIB manuals have been included here verbatim. | |
155 | ||
156 | @c Since Guile 1.4, Neil Jerram has been maintaining and improving the | |
157 | @c reference manual. Among other contributions, he wrote the Basic | |
158 | @c Ideas chapter, developed the tools for keeping the manual in sync | |
159 | @c with snarfed libguile docstrings, and reorganized the structure so as | |
160 | @c to accommodate docstrings for all Guile's primitives. | |
161 | ||
162 | @c Martin Grabmueller has made substantial contributions throughout the | |
163 | @c reference manual in preparation for the Guile 1.6 release, including | |
164 | @c filling out a lot of the documentation of Scheme data types, control | |
165 | @c mechanisms and procedures. In addition, he wrote the documentation | |
166 | @c for Guile's SRFI modules and modules associated with the Guile REPL. | |
167 | ||
168 | @author Mark Galassi | |
169 | @author Cygnus Solution and Los Alamos National Laboratory | |
170 | @author @email{rosalia@@cygnus.com} | |
171 | @author | |
172 | @author Jim Blandy | |
173 | @author Free Software Foundation and MIT AI Lab | |
174 | @author @email{jimb@@red-bean.com} | |
175 | @author | |
176 | @author Gary Houston | |
177 | @author @email{ghouston@@arglist.com} | |
178 | @author | |
179 | @author Tim Pierce | |
180 | @author @email{twp@@skepsis.com} | |
181 | @author | |
182 | @author Neil Jerram | |
183 | @author @email{neil@@ossau.uklinux.net} | |
184 | @author | |
185 | @author Martin Grabmueller | |
186 | @author @email{mgrabmue@@cs.tu-berlin.de} | |
370babab | 187 | |
38a93523 NJ |
188 | @c The following two commands start the copyright page. |
189 | @page | |
190 | @vskip 0pt plus 1filll | |
191 | @vskip 0pt plus 1filll | |
d3830c6b | 192 | @insertcopying |
38a93523 NJ |
193 | @end titlepage |
194 | ||
195 | @c @smallbook | |
196 | @finalout | |
197 | @headings double | |
198 | ||
199 | @c Where to find Guile examples. | |
200 | @set example-dir doc/examples | |
201 | ||
801892e7 | 202 | @ifnottex |
38a93523 NJ |
203 | @node Top, Guile License, (dir), (dir) |
204 | @top The Guile Reference Manual | |
205 | ||
d3830c6b KR |
206 | @insertcopying |
207 | @sp 1 | |
801892e7 | 208 | @end ifnottex |
38a93523 NJ |
209 | |
210 | @menu | |
211 | Preface | |
212 | ||
213 | * Guile License:: Conditions for copying and using Guile. | |
214 | * Manual Layout:: How to read the rest of this manual. | |
370babab | 215 | * Manual Conventions:: Conventional terminology. |
38a93523 NJ |
216 | |
217 | Part I: Introduction to Guile | |
218 | ||
219 | * What is Guile?:: And what does it do? | |
73ede592 | 220 | * Whirlwind Tour:: An introductory whirlwind tour. |
9401323e | 221 | * Obtaining and Installing Guile:: |
38a93523 NJ |
222 | * Reporting Bugs:: Reporting bugs in Guile or this manual. |
223 | ||
ce9d0562 | 224 | Part II: Writing and Running Guile Scheme |
38a93523 | 225 | |
ce9d0562 NJ |
226 | * Running Intro:: Introduction to this part. |
227 | * Guile Scheme:: Guile's implementation of Scheme. | |
9401323e NJ |
228 | * Guile Scripting:: How to write Guile scripts. |
229 | * Command Line Handling:: Command line options and arguments. | |
ce9d0562 NJ |
230 | * Debugging Features:: Features for debugging errors. |
231 | * Autoconf Support:: Guile-specific configure.in macros. | |
232 | * Miscellaneous Tools:: Snarfing, linting, etc. | |
233 | * Basic Ideas:: Basic ideas in Scheme. | |
234 | * Further Reading:: Where to find out more about Scheme. | |
235 | ||
236 | Part III: Guile as an Extension Language | |
237 | ||
238 | * Programming Intro:: Introduction to this part. | |
9401323e | 239 | * Libguile Intro:: Using Guile as an extension language. |
ce9d0562 | 240 | * Programming Overview:: An overview of Guile programming. |
9401323e NJ |
241 | * Data Representation:: Data representation in Guile. |
242 | * GH:: The deprecated GH interface. | |
9401323e | 243 | |
ce9d0562 | 244 | Part IV: Guile API Reference |
9401323e NJ |
245 | |
246 | * Reference Intro:: Introduction to the Guile API reference. | |
ce9d0562 | 247 | * API Overview:: Overview of the Guile API. |
4c731ece NJ |
248 | * Simple Data Types:: Numbers, strings, booleans and so on. |
249 | * Compound Data Types:: Data types for holding other data. | |
38a93523 NJ |
250 | * Procedures and Macros:: Procedures and macros. |
251 | * Utility Functions:: General utility functions. | |
252 | * Binding Constructs:: Definitions and variable bindings. | |
253 | * Control Mechanisms:: Controlling the flow of program execution. | |
254 | * Input and Output:: Ports, reading and writing. | |
255 | * Read/Load/Eval:: Reading and evaluating Scheme code. | |
256 | * Memory Management:: Memory management and garbage collection. | |
257 | * Objects:: Low level object orientation support. | |
258 | * Modules:: Designing reusable code libraries. | |
259 | * Scheduling:: Threads, mutexes, asyncs and dynamic roots. | |
c936bede | 260 | * Options and Config:: Configuration, features and runtime options. |
38a93523 NJ |
261 | * Translation:: Support for translating other languages. |
262 | * Debugging:: Internal debugging interface. | |
263 | * Deprecated:: Features that are planned to disappear. | |
38a93523 | 264 | |
ce9d0562 | 265 | Part V: Guile Modules |
38a93523 NJ |
266 | |
267 | * SLIB:: Using the SLIB Scheme library. | |
268 | * POSIX:: POSIX system calls and networking. | |
fc8529c7 | 269 | * SRFI Support:: Support for various SRFIs. |
fc8529c7 MG |
270 | * Readline Support:: Module for using the readline library. |
271 | * Value History:: Maintaining a value history in the REPL. | |
c2537425 MG |
272 | * Pretty Printing:: Nicely formatting Scheme objects for output. |
273 | * Formatted Output:: The @code{format} procedure. | |
2a946b44 | 274 | * Rx Regexps:: The Rx regular expression library. |
e1bc8c34 | 275 | * File Tree Walk:: Traversing the file system. |
5ad1686a | 276 | * Queues:: First-in first-out queuing. |
38a93523 | 277 | * Expect:: Controlling interactive programs with Guile. |
a42b5e5b | 278 | * The Scheme shell (scsh):: Using scsh interfaces in Guile. |
38a93523 | 279 | |
c6ae9c77 MV |
280 | Appendices |
281 | ||
282 | * GNU Free Documentation License:: The license of this manual. | |
283 | ||
38a93523 NJ |
284 | Indices |
285 | ||
286 | * Concept Index:: | |
287 | * Procedure Index:: | |
288 | * Variable Index:: | |
289 | * Type Index:: | |
255ea784 | 290 | * R5RS Index:: |
38a93523 NJ |
291 | |
292 | @end menu | |
293 | ||
05c4ffe1 KR |
294 | @contents |
295 | ||
38a93523 NJ |
296 | @include preface.texi |
297 | ||
38a93523 NJ |
298 | @iftex |
299 | @page | |
300 | @unnumbered{Part I: Introduction to Guile} | |
301 | @end iftex | |
302 | ||
303 | @include intro.texi | |
304 | ||
38a93523 | 305 | @page |
ce9d0562 NJ |
306 | @node Running Intro |
307 | @unnumbered Part II: Writing and Running Guile Scheme | |
9401323e | 308 | |
ce9d0562 NJ |
309 | Guile's core language is Scheme, and an awful lot can be achieved simply |
310 | by using Guile to write and run Scheme programs. In this part of the | |
311 | manual, we explain how to use Guile in this mode, and describe the tools | |
312 | that Guile provides to help you with script writing, debugging and | |
313 | packaging your programs for distribution. | |
38a93523 | 314 | |
ce9d0562 NJ |
315 | For readers who are not yet familiar with the Scheme language, this part |
316 | includes a chapter that presents the basic concepts of the language, and | |
317 | gives references to freely available Scheme tutorial material on the | |
318 | web. | |
319 | ||
320 | For detailed reference information on the variables, functions etc. that | |
321 | make up Guile's application programming interface (API), please refer to | |
322 | Part IV (@pxref{Reference Intro,,Part IV --- Guile API Reference}). | |
9401323e | 323 | |
38a93523 | 324 | @include scheme-intro.texi |
9401323e NJ |
325 | @include scripts.texi |
326 | @include script-getopt.texi | |
9401323e | 327 | @include debugging.texi |
dc81cfeb | 328 | @include autoconf.texi |
73ede592 | 329 | @include tools.texi |
ce9d0562 | 330 | @include scheme-ideas.texi |
9401323e NJ |
331 | @include scheme-reading.texi |
332 | ||
ce9d0562 NJ |
333 | @page |
334 | @node Programming Intro | |
335 | @unnumbered Part III: Guile as an Extension Language | |
336 | ||
337 | In this part of the manual, we aim to present a wide ranging picture of | |
338 | what it means to use Guile as an application extension language, to | |
339 | provide guidance, practical guidelines and tips for @emph{how} to | |
340 | program in Guile, and to document the tools that are available to help | |
341 | you with your programming. For detailed reference information on the | |
342 | variables, functions etc. that make up Guile's application programming | |
343 | interface (API), please refer to Part IV (@pxref{Reference Intro,,Part | |
344 | IV --- Guile API Reference}). | |
345 | ||
346 | @include extend.texi | |
347 | @include program.texi | |
348 | @include data-rep.texi | |
349 | @include gh.texi | |
350 | ||
9401323e NJ |
351 | @page |
352 | @node Reference Intro | |
ce9d0562 | 353 | @unnumbered Part IV: Guile API Reference |
9401323e | 354 | |
a7a7bb95 NJ |
355 | Guile provides an application programming interface (@dfn{API}) to |
356 | developers in two core languages: Scheme and C. This part of the manual | |
357 | contains reference documentation for all of the functionality that is | |
358 | available through both Scheme and C interfaces. | |
359 | ||
ce9d0562 | 360 | @include scm.texi |
38a93523 | 361 | @include scheme-data.texi |
4c731ece | 362 | @include scheme-compound.texi |
38a93523 NJ |
363 | @include scheme-procedures.texi |
364 | @include scheme-utility.texi | |
365 | @include scheme-binding.texi | |
366 | @include scheme-control.texi | |
367 | @include scheme-io.texi | |
368 | @include scheme-evaluation.texi | |
369 | @include scheme-memory.texi | |
370 | @include scheme-modules.texi | |
371 | @include scheme-scheduling.texi | |
372 | @c object orientation support here | |
373 | @include scheme-options.texi | |
374 | @include scheme-translation.texi | |
375 | @include scheme-debug.texi | |
376 | @include deprecated.texi | |
38a93523 | 377 | |
38a93523 NJ |
378 | @iftex |
379 | @page | |
ce9d0562 | 380 | @unnumbered{Part V: Guile Modules} |
38a93523 NJ |
381 | @end iftex |
382 | ||
383 | @include slib.texi | |
384 | @include posix.texi | |
fc8529c7 | 385 | @include srfi-modules.texi |
fc8529c7 | 386 | @include repl-modules.texi |
c2537425 | 387 | @include misc-modules.texi |
38a93523 NJ |
388 | @include expect.texi |
389 | @include scsh.texi | |
38a93523 | 390 | |
c6ae9c77 MV |
391 | @include fdl.texi |
392 | ||
38a93523 NJ |
393 | @iftex |
394 | @page | |
395 | @unnumbered{Indices} | |
396 | @end iftex | |
397 | ||
398 | @include indices.texi | |
9401323e | 399 | @include scheme-indices.texi |
38a93523 | 400 | |
38a93523 | 401 | @bye |