r6rs docs in the manual
[bpt/guile.git] / doc / ref / r6rs.texi
CommitLineData
845cbcfe
AW
1@c -*-texinfo-*-
2@c This is part of the GNU Guile Reference Manual.
3@c Copyright (C) 2010
4@c Free Software Foundation, Inc.
5@c See the file guile.texi for copying conditions.
6
7@node R6RS Support
8@section R6RS Support
9@cindex R6RS
10
11@xref{R6RS Libraries}, for more information on how to define R6RS libraries, and
12their integration with Guile modules.
13
14@menu
15* R6RS Incompatibilities:: Guile mostly implements R6RS.
16* R6RS Standard Libraries:: Modules defined by the R6RS.
17@end menu
18
19@node R6RS Incompatibilities
20@subsection Incompatibilities with the R6RS
21
22There are some incompatibilities between Guile and the R6RS. Some of them are
23intentional, some of them are bugs, and some are simply unimplemented features.
24Please let the Guile developers know if you find one that is not on this list.
25
26@itemize
27@item
28In the R6RS, internal definitions expand to @code{letrec*}, not @code{letrec}.
29Guile does not support @code{letrec*}, though that would be nice.
30
31@item
32The R6RS specifies many situations in which a conforming implementation must
33signal a specific error. Guile doesn't really care about that too much -- if a
34correct R6RS program would not hit that error, we don't bother checking for it.
35
36@item
37Multiple @code{library} forms in one file are not yet supported. This is because
38the expansion of @code{library} sets the current module, but does not restore
39it. This is a bug.
40@end itemize
41
42
43@node R6RS Standard Libraries
44@subsection R6RS Standard Libraries
45
46The R6RS standard defines a core language and a number of standard libraries.
47Here we briefly list the libraries that have been implemented for Guile.
48
49All of these libraries are available as Guile modules, for use in standard Guile
50code, via @code{use-modules}, or for use in portable R6RS code, via the
51@code{library} and @code{import} forms. @xref{R6RS Libraries}, for more
52information.
53
54We do not attempt to document these libraries fully here, as most of their
55functionality is already available in Guile itself. The expectation is that most
56Guile users will use the well-known and well-documented Guile modules. These
57R6RS libraries are mostly useful to users who want to port their code to other
58R6RS systems, in which case a copy of the R6RS report itself is necessary. It
59may be found at the R6RS web page, @url{http://r6rs.org/}.
60
61First, there is the base library, defined in the base R6RS report:
62
63@example
64(use-modules (rnrs base))
65@end example
66
67One may also import it to the current module using the R6RS @code{import} form:
68
69@example
70(import (rnrs base))
71@end example
72
73All of the @code{rnrs} modules have the version of @code{(6)}, which may be
74specified when importing the module:
75
76@example
77(import (rnrs base (6)))
78(use-modules ((rnrs base) #:version (6)))
79@end example
80
81@xref{R6RS Version References}, for more information on versions.
82
83Next there is a set of libraries that collectively form the @code{(rnrs)}
84composite library. The following statements are equivalent:
85
86@example
87(import (rnrs))
88
89(use-modules (rnrs))
90
91(import (rnrs arithmetic bitwise (6))
92 (rnrs arithmetic fixnums (6))
93 (rnrs arithmetic flonums (6))
94 (rnrs base (6))
95 (rnrs bytevectors)
96 (rnrs conditions (6))
97 (rnrs control (6))
98 (rnrs enums (6))
99 (rnrs exceptions (6))
100 (rnrs files (6))
101 (rnrs hashtables (6))
102 (rnrs io ports)
103 (rnrs io simple (6))
104 (rnrs lists (6))
105 (rnrs programs (6))
106 (rnrs records inspection (6))
107 (rnrs records procedural (6))
108 (rnrs records syntactic (6))
109 (rnrs sorting (6))
110 (rnrs syntax-case (6)))
111@end example
112
113Finally there are a number of modules that the @code{(rnrs)} module does not
114re-export:
115
116@example
117(import (rnrs mutable-pairs (6))
118 (rnrs mutable-strings (6))
119 (rnrs r5rs (6))
120 (rnrs eval (6))
121 (rnrs unicode (6)))
122@end example
123
124See the R6RS Standard Libraries specification, for more information on these
125modules.
126
127@c r6rs.texi ends here
128
129@c Local Variables:
130@c TeX-master: "guile.texi"
131@c End: