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