Integrate complete R6RS standard libraries documentation.
[bpt/guile.git] / doc / ref / r6rs.texi
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
12 their 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
22 There are some incompatibilities between Guile and the R6RS. Some of
23 them are intentional, some of them are bugs, and some are simply
24 unimplemented features. Please let the Guile developers know if you
25 find one that is not on this list.
26
27 @itemize
28 @item
29 The R6RS specifies many situations in which a conforming implementation
30 must signal a specific error. Guile doesn't really care about that too
31 much --- if a correct R6RS program would not hit that error, we don't
32 bother checking for it.
33
34 @item
35 Multiple @code{library} forms in one file are not yet supported. This
36 is because the expansion of @code{library} sets the current module, but
37 does not restore it. This is a bug.
38
39 @item
40 A @code{set!} to a variable transformer may only expand to an
41 expression, not a definition --- even if the original @code{set!}
42 expression was in definition context.
43 @end itemize
44
45 @node R6RS Standard Libraries
46 @subsection R6RS Standard Libraries
47
48 In contrast with earlier versions of the Revised Report, the R6RS
49 organizes the procedures and syntactic forms required of conforming
50 implementations into a set of ``standard libraries'' which can be
51 imported as necessary by user programs and libraries. Here we briefly
52 list the libraries that have been implemented for Guile.
53
54 We do not attempt to document these libraries fully here, as most of
55 their functionality is already available in Guile itself. The
56 expectation is that most Guile users will use the well-known and
57 well-documented Guile modules. These R6RS libraries are mostly useful
58 to users who want to port their code to other R6RS systems.
59
60 The documentation in the following sections reproduces some of the
61 content of the library section of the Report, but is mostly intended to
62 provide supplementary information about Guile's implementation of the
63 R6RS standard libraries. For complete documentation, design rationales
64 and further examples, we advise you to consult the ``Standard
65 Libraries'' section of the Report (@pxref{Standard Libraries,
66 R6RS Standard Libraries,, r6rs, The Revised^6 Report on the Algorithmic
67 Language Scheme}).
68
69 @menu
70 * Library Usage:: What to know about Guile's library support.
71 * rnrs base:: The base library.
72 * rnrs unicode:: Access to Unicode operations.
73 * rnrs bytevectors:: Functions for working with binary data.
74 * rnrs lists:: List utilities.
75 * rnrs sorting:: Sorting for lists and vectors.
76 * rnrs control:: Additional control structures.
77
78 * R6RS Records:: A note about R6RS records.
79 * rnrs records syntactic:: Syntactic API for R6RS records.
80 * rnrs records procedural:: Procedural API for R6RS records.
81 * rnrs records inspection:: Reflection on R6RS records.
82
83 * rnrs exceptions:: Handling exceptional situations.
84 * rnrs conditions:: Data structures for exceptions.
85
86 * I/O Conditions:: Predefined I/O error types.
87 * rnrs io ports:: Support for port-based I/O.
88 * rnrs io simple:: High-level I/O API.
89
90 * rnrs files:: Functions for working with files.
91 * rnrs programs:: Functions for working with processes.
92 * rnrs arithmetic fixnums:: Fixed-precision arithmetic operations.
93 * rnrs arithmetic flonums:: Floating-point arithmetic operations.
94 * rnrs arithmetic bitwise:: Exact bitwise arithmetic operations.
95 * rnrs syntax-case:: Support for `syntax-case' macros.
96 * rnrs hashtables:: Hashtables.
97 * rnrs enums:: Enumerations.
98 * rnrs:: The composite library.
99 * rnrs eval:: Support for on-the-fly evaluation.
100 * rnrs mutable-pairs:: Support for mutable pairs.
101 * rnrs mutable-strings:: Support for mutable strings.
102 * rnrs r5rs:: Compatibility layer for R5RS Scheme.
103
104 @end menu
105
106 @node Library Usage
107 @subsubsection Library Usage
108
109 Guile implements the R6RS `library' form as a transformation to a native
110 Guile module definition. As a consequence of this, all of the libraries
111 described in the following subsections, in addition to being available
112 for use by R6RS libraries and top-level programs, can also be imported
113 as if they were normal Guile modules --- for example, via a
114 @code{use-modules} form. For example, the R6RS ``composite'' library
115 can be imported by:
116
117 @lisp
118 (import (rnrs (6)))
119 @end lisp
120
121 @lisp
122 (use-modules ((rnrs) :version (6)))
123 @end lisp
124
125 For more information on Guile's library implementation, see
126 (@pxref{R6RS Libraries}).
127
128 @node rnrs base
129 @subsubsection rnrs base
130
131 The @code{(rnrs base (6))} library exports the procedures and syntactic
132 forms described in the main section of the Report
133 (@pxref{Base library, R6RS Base library,, r6rs,
134 The Revised^6 Report on the Algorithmic Language Scheme}). They are
135 grouped below by the existing manual sections to which they correspond.
136
137 @deffn {Scheme Procedure} boolean? obj
138 @deffnx {Scheme Procedure} not x
139 @xref{Booleans}, for documentation.
140 @end deffn
141
142 @deffn {Scheme Procedure} symbol? obj
143 @deffnx {Scheme Procedure} symbol->string sym
144 @deffnx {Scheme Procedure} string->symbol str
145 @xref{Symbol Primitives}, for documentation.
146 @end deffn
147
148 @deffn {Scheme Procedure} char? obj
149 @deffnx {Scheme Procedure} char=?
150 @deffnx {Scheme Procedure} char<?
151 @deffnx {Scheme Procedure} char>?
152 @deffnx {Scheme Procedure} char<=?
153 @deffnx {Scheme Procedure} char>=?
154 @deffnx {Scheme Procedure} integer->char n
155 @deffnx {Scheme Procedure} char->integer chr
156 @xref{Characters}, for documentation.
157 @end deffn
158
159 @deffn {Scheme Procedure} list? x
160 @deffnx {Scheme Procedure} null? x
161 @xref{List Predicates}, for documentation.
162 @end deffn
163
164 @deffn {Scheme Procedure} pair? x
165 @deffnx {Scheme Procedure} cons x y
166 @deffnx {Scheme Procedure} car pair
167 @deffnx {Scheme Procedure} cdr pair
168 @deffnx {Scheme Procedure} caar pair
169 @deffnx {Scheme Procedure} cadr pair
170 @deffnx {Scheme Procedure} cdar pair
171 @deffnx {Scheme Procedure} cddr pair
172 @deffnx {Scheme Procedure} caaar pair
173 @deffnx {Scheme Procedure} caadr pair
174 @deffnx {Scheme Procedure} cadar pair
175 @deffnx {Scheme Procedure} cdaar pair
176 @deffnx {Scheme Procedure} caddr pair
177 @deffnx {Scheme Procedure} cdadr pair
178 @deffnx {Scheme Procedure} cddar pair
179 @deffnx {Scheme Procedure} cdddr pair
180 @deffnx {Scheme Procedure} caaaar pair
181 @deffnx {Scheme Procedure} caaadr pair
182 @deffnx {Scheme Procedure} caadar pair
183 @deffnx {Scheme Procedure} cadaar pair
184 @deffnx {Scheme Procedure} cdaaar pair
185 @deffnx {Scheme Procedure} cddaar pair
186 @deffnx {Scheme Procedure} cdadar pair
187 @deffnx {Scheme Procedure} cdaadr pair
188 @deffnx {Scheme Procedure} cadadr pair
189 @deffnx {Scheme Procedure} caaddr pair
190 @deffnx {Scheme Procedure} caddar pair
191 @deffnx {Scheme Procedure} cadddr pair
192 @deffnx {Scheme Procedure} cdaddr pair
193 @deffnx {Scheme Procedure} cddadr pair
194 @deffnx {Scheme Procedure} cdddar pair
195 @deffnx {Scheme Procedure} cddddr pair
196 @xref{Pairs}, for documentation.
197 @end deffn
198
199 @deffn {Scheme Procedure} number? obj
200 @xref{Numerical Tower}, for documentation.
201 @end deffn
202
203 @deffn {Scheme Procedure} string? obj
204 @xref{String Predicates}, for documentation.
205 @end deffn
206
207 @deffn {Scheme Procedure} procedure? obj
208 @xref{Procedure Properties}, for documentation.
209 @end deffn
210
211 @deffn {Scheme Syntax} define name value
212 @deffnx {Scheme Syntax} set! variable-name value
213 @xref{Definition}, for documentation.
214 @end deffn
215
216 @deffn {Scheme Syntax} define-syntax keyword expression
217 @deffnx {Scheme Syntax} let-syntax ((keyword transformer) ...) exp ...
218 @deffnx {Scheme Syntax} letrec-syntax ((keyword transformer) ...) exp ...
219 @xref{Defining Macros}, for documentation.
220 @end deffn
221
222 @deffn {Scheme Syntax} identifier-syntax exp
223 @xref{Identifier Macros}, for documentation.
224 @end deffn
225
226 @deffn {Scheme Syntax} syntax-rules literals (pattern template) ...
227 @xref{Syntax Rules}, for documentation.
228 @end deffn
229
230 @deffn {Scheme Syntax} lambda formals body
231 @xref{Lambda}, for documentation.
232 @end deffn
233
234 @deffn {Scheme Syntax} let bindings body
235 @deffnx {Scheme Syntax} let* bindings body
236 @deffnx {Scheme Syntax} letrec bindings body
237 @xref{Local Bindings}, for documentation.
238 @end deffn
239
240 @deffn {Scheme Syntax} let-values bindings body
241 @deffnx {Scheme Syntax} let*-values bindings body
242 @xref{SRFI-11}, for documentation.
243 @end deffn
244
245 @deffn {Scheme Syntax} begin expr1 expr2 ...
246 @xref{begin}, for documentation.
247 @end deffn
248
249 @deffn {Scheme Syntax} quote expr
250 @deffnx {Scheme Syntax} quasiquote expr
251 @deffnx {Scheme Syntax} unquote expr
252 @deffnx {Scheme Syntax} unquote-splicing expr
253 @xref{Expression Syntax}, for documentation.
254 @end deffn
255
256 @deffn {Scheme Syntax} if test consequence [alternate]
257 @deffnx {Scheme Syntax} cond clause1 clause2 ...
258 @deffnx {Scheme Syntax} case key clause1 clause2 ...
259 @xref{if cond case}, for documentation.
260 @end deffn
261
262 @deffn {Scheme Syntax} and expr ...
263 @deffnx {Scheme Syntax} or expr ...
264 @xref{and or}, for documentation.
265 @end deffn
266
267 @deffn {Scheme Procedure} eq? x y
268 @deffnx {Scheme Procedure} eqv? x y
269 @deffnx {Scheme Procedure} equal? x y
270 @deffnx {Scheme Procedure} symbol=? symbol1 symbol2 ...
271 @xref{Equality}, for documentation.
272
273 @code{symbol=?} is identical to @code{eq?}.
274 @end deffn
275
276 @deffn {Scheme Procedure} complex? z
277 @xref{Complex Numbers}, for documentation.
278 @end deffn
279
280 @deffn {Scheme Procedure} real-part z
281 @deffnx {Scheme Procedure} imag-part z
282 @deffnx {Scheme Procedure} make-rectangular real_part imaginary_part
283 @deffnx {Scheme Procedure} make-polar x y
284 @deffnx {Scheme Procedure} magnitude z
285 @deffnx {Scheme Procedure} angle z
286 @xref{Complex}, for documentation.
287 @end deffn
288
289 @deffn {Scheme Procedure} sqrt z
290 @deffnx {Scheme Procedure} exp z
291 @deffnx {Scheme Procedure} expt z1 z2
292 @deffnx {Scheme Procedure} log z
293 @deffnx {Scheme Procedure} sin z
294 @deffnx {Scheme Procedure} cos z
295 @deffnx {Scheme Procedure} tan z
296 @deffnx {Scheme Procedure} asin z
297 @deffnx {Scheme Procedure} acos z
298 @deffnx {Scheme Procedure} atan z
299 @xref{Scientific}, for documentation.
300 @end deffn
301
302 @deffn {Scheme Procedure} real? x
303 @deffnx {Scheme Procedure} rational? x
304 @deffnx {Scheme Procedure} nan? x
305 @deffnx {Scheme Procedure} numerator x
306 @deffnx {Scheme Procedure} denominator x
307 @deffnx {Scheme Procedure} rationalize x eps
308 @xref{Reals and Rationals}, for documentation.
309 @end deffn
310
311 @deffn {Scheme Procedure} exact? x
312 @deffnx {Scheme Procedure} inexact? x
313 @deffnx {Scheme Procedure} exact z
314 @deffnx {Scheme Procedure} inexact z
315 @xref{Exactness}, for documentation. The @code{exact} and
316 @code{inexact} procedures are identical to the @code{inexact->exact} and
317 @code{exact->inexact} procedures provided by Guile's code library.
318 @end deffn
319
320 @deffn {Scheme Procedure} integer? x
321 @xref{Integers}, for documentation.
322 @end deffn
323
324 @deffn {Scheme Procedure} odd? n
325 @deffnx {Scheme Procedure} even? n
326 @deffnx {Scheme Procedure} gcd x ...
327 @deffnx {Scheme Procedure} lcm x ...
328 @xref{Integer Operations}, for documentation.
329 @end deffn
330
331 @deffn {Scheme Procedure} =
332 @deffnx {Scheme Procedure} <
333 @deffnx {Scheme Procedure} >
334 @deffnx {Scheme Procedure} <=
335 @deffnx {Scheme Procedure} >=
336 @deffnx {Scheme Procedure} zero? x
337 @deffnx {Scheme Procedure} positive? x
338 @deffnx {Scheme Procedure} negative? x
339 @xref{Comparison}, for documentation.
340 @end deffn
341
342 @deffn {Scheme Procedure} fold f lst1 lst2 ...
343 @deffnx {Scheme Procedure} for-each f lst1 lst2 ...
344 @xref{SRFI-1 Fold and Map}, for documentation.
345 @end deffn
346
347 @deffn {Scheme Procedure} list elem1 ... elemN
348 @xref{List Constructors}, for documentation.
349 @end deffn
350
351 @deffn {Scheme Procedure} length lst
352 @deffnx {Scheme Procedure} list-ref lst k
353 @deffnx {Scheme Procedure} list-tail lst k
354 @xref{List Selection}, for documentation.
355 @end deffn
356
357 @deffn {Scheme Procedure} append lst1 ... lstN
358 @deffnx {Scheme Procedure} reverse lst
359 @xref{Append/Reverse}, for documentation.
360 @end deffn
361
362 @deffn {Scheme Procedure} number->string n [radix]
363 @deffnx {Scheme Procedure} string->number str [radix]
364 @xref{Conversion}, for documentation.
365 @end deffn
366
367 @deffn {Scheme Procedure} string char ...
368 @deffnx {Scheme Procedure} make-string k [chr]
369 @deffnx {Scheme Procedure} list->string lst
370 @xref{String Constructors}, for documentation.
371 @end deffn
372
373 @deffn {Scheme Procedure} string->list str [start [end]]
374 @xref{List/String Conversion}, for documentation.
375 @end deffn
376
377 @deffn {Scheme Procedure} string-length str
378 @deffnx {Scheme Procedure} string-ref str k
379 @deffnx {Scheme Procedure} string-copy str [start [end]]
380 @deffnx {Scheme Procedure} substring str start [end]
381 @xref{String Selection}, for documentation.
382 @end deffn
383
384 @deffn {Scheme Procedure} string=? [s1 [s2 . rest]]
385 @deffnx {Scheme Procedure} string<? [s1 [s2 . rest]]
386 @deffnx {Scheme Procedure} string>? [s1 [s2 . rest]]
387 @deffnx {Scheme Procedure} string<=? [s1 [s2 . rest]]
388 @deffnx {Scheme Procedure} string>=? [s1 [s2 . rest]]
389 @xref{String Comparison}, for documentation.
390 @end deffn
391
392 @deffn {Scheme Procedure} string-append . args
393 @xref{Reversing and Appending Strings}, for documentation.
394 @end deffn
395
396 @deffn {Scheme Procedure} string-for-each proc s [start [end]]
397 @xref{Mapping Folding and Unfolding}, for documentation.
398 @end deffn
399
400 @deffn {Scheme Procedure} + z1 ...
401 @deffnx {Scheme Procedure} - z1 z2 ...
402 @deffnx {Scheme Procedure} * z1 ...
403 @deffnx {Scheme Procedure} / z1 z2 ...
404 @deffnx {Scheme Procedure} max x1 x2 ...
405 @deffnx {Scheme Procedure} min x1 x2 ...
406 @deffnx {Scheme Procedure} abs x
407 @deffnx {Scheme Procedure} truncate x
408 @deffnx {Scheme Procedure} floor x
409 @deffnx {Scheme Procedure} ceiling x
410 @deffnx {Scheme Procedure} round x
411 @xref{Arithmetic}, for documentation.
412 @end deffn
413
414 @deffn {Scheme Procedure} div x1 x2
415 @deffnx {Scheme Procedure} mod x1 x2
416 @deffnx {Scheme Procedure} div-and-mod x1 x2
417 These procedures implement number-theoretic division.
418
419 @code{div-and-mod} returns two values, the respective results of
420 @code{(div x1 x2)} and @code{(mod x1 x2)}.
421 @end deffn
422
423 @deffn {Scheme Procedure} div0 x1 x2
424 @deffnx {Scheme Procedure} mod0 x1 x2
425 @deffnx {Scheme Procedure} div0-and-mod0 x1 x2
426 These procedures are similar to @code{div}, @code{mod}, and
427 @code{div-and-mod}, except that @code{mod0} returns values that lie
428 within a half-open interval centered on zero.
429 @end deffn
430
431 @deffn {Scheme Procedure} exact-integer-sqrt k
432 This procedure returns two nonnegative integer objects @code{s} and
433 @code{r} such that k = s^2 + r and k < (s + 1)^2.
434 @end deffn
435
436 @deffn {Scheme Procedure} real-valued? obj
437 @deffnx {Scheme Procedure} rational-valued? obj
438 @deffnx {Scheme Procedure} integer-valued? obj
439 These procedures return @code{#t} if and only if their arguments can,
440 respectively, be coerced to a real, rational, or integer value without a
441 loss of numerical precision.
442
443 @code{real-valued?} will return @code{#t} for complex numbers whose
444 imaginary parts are zero.
445 @end deffn
446
447 @deffn {Scheme Procedure} finite? x
448 @deffnx {Scheme Procedure} infinite? x
449 @code{infinite?} returns @code{#t} if @var{x} is an infinite value,
450 @code{#f} otherwise. @code{finite?} returns the negation of
451 @code{infinite?}.
452 @end deffn
453
454 @deffn {Scheme Syntax} assert expr
455 Raises an @code{&assertion} condition if @var{expr} evaluates to
456 @code{#f}; otherwise evaluates to the value of @var{expr}.
457 @end deffn
458
459 @deffn {Scheme Procedure} error who message irritant1 ...
460 @deffnx {Scheme Procedure} assertion-violation who message irritant1 ...
461 These procedures raise compound conditions based on their arguments:
462 If @var{who} is not @code{#f}, the condition will include a @code{&who}
463 condition whose @code{who} field is set to @var{who}; a @code{&message}
464 condition will be included with a @code{message} field equal to
465 @var{message}; an @code{&irritants} condition will be included with its
466 @code{irritants} list given by @code{irritant1 ...}.
467
468 @code{error} produces a compound condition with the simple conditions
469 described above, as well as an @code{&error} condition;
470 @code{assertion-violation} produces one that includes an
471 @code{&assertion} condition.
472 @end deffn
473
474 @deffn {Scheme Procedure} vector-map proc v
475 @deffnx {Scheme Procedure} vector-for-each proc v
476 These procedures implement the @code{map} and @code{for-each} contracts
477 over vectors.
478 @end deffn
479
480 @deffn {Scheme Procedure} vector . l
481 @deffnx {Scheme Procedure} vector? obj
482 @deffnx {Scheme Procedure} make-vector len
483 @deffnx {Scheme Procedure} make-vector len fill
484 @deffnx {Scheme Procedure} list->vector l
485 @deffnx {Scheme Procedure} vector->list v
486 @xref{Vector Creation}, for documentation.
487 @end deffn
488
489 @deffn {Scheme Procedure} vector-length vector
490 @deffnx {Scheme Procedure} vector-ref vector k
491 @deffnx {Scheme Procedure} vector-set! vector k obj
492 @deffnx {Scheme Procedure} vector-fill! v fill
493 @xref{Vector Accessors}, for documentation.
494 @end deffn
495
496 @deffn {Scheme Procedure} call-with-current-continuation proc
497 @deffnx {Scheme Procedure} call/cc proc
498 @xref{Continuations}, for documentation.
499 @end deffn
500
501 @deffn {Scheme Procedure} values arg1 ... argN
502 @deffnx {Scheme Procedure} call-with-values producer consumer
503 @xref{Multiple Values}, for documentation.
504 @end deffn
505
506 @deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard
507 @xref{Dynamic Wind}, for documentation.
508 @end deffn
509
510 @deffn {Scheme Procedure} apply proc arg1 ... argN arglst
511 @xref{Fly Evaluation}, for documentation.
512 @end deffn
513
514 @node rnrs unicode
515 @subsubsection rnrs unicode
516
517 The @code{(rnrs unicode (6))} library provides procedures for
518 manipulating Unicode characters and strings.
519
520 @deffn {Scheme Procedure} char-upcase char
521 @deffnx {Scheme Procedure} char-downcase char
522 @deffnx {Scheme Procedure} char-titlecase char
523 @deffnx {Scheme Procedure} char-foldcase char
524 These procedures translate their arguments from one Unicode character
525 set to another. @code{char-upcase}, @code{char-downcase}, and
526 @code{char-titlecase} are identical to their counterparts in the
527 Guile core library; see (@pxref{Characters}) for documentation.
528
529 @code{char-foldcase} returns the result of applying @code{char-upcase}
530 to its argument, followed by @code{char-downcase} --- except in the case
531 of the Turkic characters @code{U+0130} and @code{U+0131}, for which the
532 procedure acts as the identity function.
533 @end deffn
534
535 @deffn {Scheme Procedure} char-ci=? char1 char2 char3 ...
536 @deffnx {Scheme Procedure} char-ci<? char1 char2 char3 ...
537 @deffnx {Scheme Procedure} char-ci>? char1 char2 char3 ...
538 @deffnx {Scheme Procedure} char-ci<=? char1 char2 char3 ...
539 @deffnx {Scheme Procedure} char-ci>=? char1 char2 char3 ...
540 These procedures facilitate case-insensitive comparison of Unicode
541 characters. They are identical to the procedures provided by Guile's
542 core library. @xref{Characters}, for documentation.
543 @end deffn
544
545 @deffn {Scheme Procedure} char-alphabetic? char
546 @deffnx {Scheme Procedure} char-numeric? char
547 @deffnx {Scheme Procedure} char-whitespace? char
548 @deffnx {Scheme Procedure} char-upper-case? char
549 @deffnx {Scheme Procedure} char-lower-case? char
550 @deffnx {Scheme Procedure} char-title-case? char
551 These procedures implement various Unicode character set predicates.
552 They are identical to the procedures provided by Guile's core library.
553 @xref{Characters}, for documentation.
554 @end deffn
555
556 @deffn {Scheme Procedure} char-general-category char
557 @xref{Characters}, for documentation.
558 @end deffn
559
560 @deffn {Scheme Procedure} string-upcase string
561 @deffnx {Scheme Procedure} string-downcase string
562 @deffnx {Scheme Procedure} string-titlecase string
563 @deffnx {Scheme Procedure} string-foldcase string
564 These procedures perform Unicode case folding operations on their input.
565 @xref{Alphabetic Case Mapping}, for documentation.
566 @end deffn
567
568 @deffn {Scheme Procedure} string-ci=? string1 string2 string3 ...
569 @deffnx {Scheme Procedure} string-ci<? string1 string2 string3 ...
570 @deffnx {Scheme Procedure} string-ci>? string1 string2 string3 ...
571 @deffnx {Scheme Procedure} string-ci<=? string1 string2 string3 ...
572 @deffnx {Scheme Procedure} string-ci>=? string1 string2 string3 ...
573 These procedures perform case-insensitive comparison on their input.
574 @xref{String Comparison}, for documentation.
575 @end deffn
576
577 @deffn {Scheme Procedure} string-normalize-nfd string
578 @deffnx {Scheme Procedure} string-normalize-nfkd string
579 @deffnx {Scheme Procedure} string-normalize-nfc string
580 @deffnx {Scheme Procedure} string-normalize-nfkc string
581 These procedures perform Unicode string normalization operations on
582 their input. @xref{String Comparison}, for documentation.
583 @end deffn
584
585 @node rnrs bytevectors
586 @subsubsection rnrs bytevectors
587
588 The @code{(rnrs bytevectors (6))} library provides procedures for
589 working with blocks of binary data. This functionality is documented
590 in its own section of the manual; @xref{Bytevectors}.
591
592 @node rnrs lists
593 @subsubsection rnrs lists
594
595 The @code{(rnrs lists (6))} library provides procedures additional
596 procedures for working with lists.
597
598 @deffn {Scheme Procedure} find proc list
599 This procedure is identical to the one defined in Guile's SRFI-1
600 implementation. @xref{SRFI-1 Searching}, for documentation.
601 @end deffn
602
603 @deffn {Scheme Procedure} for-all proc list1 list2 ...
604 @deffnx {Scheme Procedure} exists proc list1 list2 ...
605
606 The @code{for-all} procedure is identical to the @code{every} procedure
607 defined by SRFI-1; the @code{exists} procedure is identical to SRFI-1's
608 @code{any}. @xref{SRFI-1 Searching}, for documentation.
609 @end deffn
610
611 @deffn {Scheme Procedure} filter proc list
612 @deffnx {Scheme Procedure} partition proc list
613 These procedures are identical to the ones provided by SRFI-1.
614 @xref{List Modification}, for a description of @code{filter};
615 (@pxref{SRFI-1 Filtering and Partitioning}) for @code{partition}.
616 @end deffn
617
618 @deffn {Scheme Procedure} fold-left combine nil list1 list2 ... listn
619 @deffnx {Scheme Procedure} fold-right combine nil list1 list2 ... listn
620 These procedures are identical to the @code{fold} and @code{fold-right}
621 procedures provided by SRFI-1. @xref{SRFI-1 Fold and Map}, for
622 documentation.
623 @end deffn
624
625 @deffn {Scheme Procedure} remp proc list
626 @deffnx {Scheme Procedure} remove obj list
627 @deffnx {Scheme Procedure} remv obj list
628 @deffnx {Scheme Procedure} remq obj list
629 @code{remove}, @code{remv}, and @code{remq} are identical to the
630 @code{delete}, @code{delv}, and @code{delq} procedures provided by
631 Guile's core library; (@pxref{List Modification}) for their
632 documentation. @code{remp} is identical to the alternate @code{remove}
633 procedure provided by SRFI-1; @xref{SRFI-1 Deleting}.
634 @end deffn
635
636 @deffn {Scheme Procedure} memp proc list
637 @deffnx {Scheme Procedure} member obj list
638 @deffnx {Scheme Procedure} memv obj list
639 @deffnx {Scheme Procedure} memq obj list
640 @code{member}, @code{memv}, and @code{memq} are identical to the
641 procedures provided by Guile's core library; (@pxref{List Searching})
642 for their documentation. @code{memp} uses the specified predicate
643 function @code{proc} to test elements of the list @var{list} --- it
644 behaves similarly to @code{find}, except that it returns the first
645 sublist of @var{list} whose @code{car} satisfies @var{proc}.
646 @end deffn
647
648 @deffn {Scheme Procedure} assp proc alist
649 @deffnx {Scheme Procedure} assoc obj alist
650 @deffnx {Scheme Procedure} assv obj alist
651 @deffnx {Scheme Procedure} assq obj alist
652 @code{assoc}, @code{assv}, and @code{assq} are identical to the
653 procedures provided by Guile's core library;
654 (@pxref{Alist Key Equality}) for their documentation. @code{assp} uses
655 the specified predicate function @code{proc} to test keys in the
656 association list @var{alist}.
657 @end deffn
658
659 @deffn {Scheme Procedure} cons* obj1 ... obj
660 @deffnx {Scheme Procedure} cons* obj
661 This procedure is identical to the one exported by Guile's core
662 library. @xref{List Constructors}, for documentation.
663 @end deffn
664
665 @node rnrs sorting
666 @subsubsection rnrs sorting
667
668 The @code{(rnrs sorting (6))} library provides procedures for sorting
669 lists and vectors.
670
671 @deffn {Scheme Procedure} list-sort proc list
672 @deffnx {Scheme Procedure} vector-sort proc vector
673 These procedures return their input sorted in ascending order, without
674 modifying the original data. @var{proc} must be a procedure that takes
675 two elements from the input list or vector as arguments, and returns a
676 true value if the first is ``less'' than the second, @code{#f}
677 otherwise. @code{list-sort} returns a list; @code{vector-sort} returns
678 a vector.
679
680 Both @code{list-sort} and @code{vector-sort} are implemented in terms of
681 the @code{stable-sort} procedure from Guile's core library.
682 @xref{Sorting}, for a discussion of the behavior of that procedure.
683 @end deffn
684
685 @deffn {Scheme Procedure} vector-sort! proc vector
686 Performs a destructive, ``in-place'' sort of @var{vector}, using
687 @var{proc} as described above to determine an ascending ordering of
688 elements. @code{vector-sort!} returns an unspecified value.
689
690 This procedure is implemented in terms of the @code{sort!} procedure
691 from Guile's core library. @xref{Sorting}, for more information.
692 @end deffn
693
694 @node rnrs control
695 @subsubsection rnrs control
696
697 The @code{(rnrs control (6))} library provides syntactic forms useful
698 for constructing conditional expressions and controlling the flow of
699 execution.
700
701 @deffn {Scheme Syntax} when test expression1 expression2 ...
702 @deffnx {Scheme Syntax} unless test expression1 expression2 ...
703 The @code{when} form is evaluated by evaluating the specified @var{test}
704 expression; if the result is a true value, the @var{expression}s that
705 follow it are evaluated in order, and the value of the final
706 @var{expression} becomes the value of the entire @code{when} expression.
707
708 The @code{unless} form behaves similarly, with the exception that the
709 specified @var{expression}s are only evaluated if the value of
710 @var{test} is false.
711 @end deffn
712
713 @deffn {Scheme Syntax} do ((variable init step) ...) (test expression ...) command ...
714 This form is identical to the one provided by Guile's core library.
715 @xref{while do}, for documentation.
716 @end deffn
717
718 @deffn {Scheme Syntax} case-lambda clause ...
719 This form is identical to the one provided by Guile's core library.
720 @xref{Case-lambda}, for documentation.
721 @end deffn
722
723 @node R6RS Records
724 @subsubsection R6RS Records
725
726 The manual sections below describe Guile's implementation of R6RS
727 records, which provide support for user-defined data types. The R6RS
728 records API provides a superset of the features provided by Guile's
729 ``native'' records, as well as those of the SRFI-9 records API;
730 (@pxref{Records}) and (@pxref{SRFI-9}) for a description of those
731 interfaces.
732
733 As with SRFI-9 and Guile's native records, R6RS records are constructed
734 using a record-type descriptor that specifies attributes like the
735 record's name, its fields, and the mutability of those fields.
736
737 R6RS records extend this framework to support single inheritance via the
738 specification of a ``parent'' type for a record type at definition time.
739 Accessors and mutator procedures for the fields of a parent type may be
740 applied to records of a subtype of this parent. A record type may be
741 @dfn{sealed}, in which case it cannot be used as the parent of another
742 record type.
743
744 The inheritance mechanism for record types also informs the process of
745 initializing the fields of a record and its parents. Constructor
746 procedures that generate new instances of a record type are obtained
747 from a record constructor descriptor, which encapsulates the record-type
748 descriptor of the record to be constructed along with a @dfn{protocol}
749 procedure that defines how constructors for record subtypes delegate to
750 the constructors of their parent types.
751
752 A protocol is a procedure used by the record system at construction time
753 to bind arguments to the fields of the record being constructed. The
754 protocol procedure is passed a procedure @var{n} that accepts the
755 arguments required to construct the record's parent type; this
756 procedure, when invoked, will return a procedure @var{p} that accepts
757 the arguments required to construct a new instance of the record type
758 itself and returns a new instance of the record type.
759
760 The protocol should in turn return a procedure that uses @var{n} and
761 @var{p} to initialize the fields of the record type and its parent
762 type(s). This procedure will be the constructor returned by
763
764 As a trivial example, consider the hypothetical record type
765 @code{pixel}, which encapsulates an x-y location on a screen, and
766 @code{voxel}, which has @code{pixel} as its parent type and stores an
767 additional coordinate. The following protocol produces a constructor
768 procedure that accepts all three coordinates, uses the first two to
769 initialize the fields of @code{pixel}, and binds the third to the single
770 field of @code{voxel}.
771
772 @lisp
773 (lambda (n)
774 (lambda (x y z)
775 (let ((p (n x y)))
776 (p z))))
777 @end lisp
778
779 It may be helpful to think of protocols as ``constructor factories''
780 that produce chains of delegating constructors glued together by the
781 helper procedure @var{n}.
782
783 An R6RS record type may be declared to be @dfn{nongenerative} via the
784 use of a unique generated or user-supplied symbol --- or @dfn{uid} ---
785 such that subsequent record type declarations with the same uid and
786 attributes will return the previously-declared record-type descriptor.
787
788 R6RS record types may also be declared to be @dfn{opaque}, in which case
789 the various predicates and introspection procedures defined in
790 @code{(rnrs records introspection)} will behave as if records of this
791 type are not records at all.
792
793 Note that while the R6RS records API shares much of its namespace with
794 both the SRFI-9 and native Guile records APIs, it is not currently
795 compatible with either.
796
797 @node rnrs records syntactic
798 @subsubsection rnrs records syntactic
799
800 The @code{(rnrs records syntactic (6))} library exports the syntactic
801 API for working with R6RS records.
802
803 @deffn {Scheme Syntax} define-record-type name-spec record-clause*
804 Defines a new record type, introducing bindings for a record-type
805 descriptor, a record constructor descriptor, a constructor procedure,
806 a record predicate, and accessor and mutator procedures for the new
807 record type's fields.
808
809 @var{name-spec} must either be an identifier or must take the form
810 @code{(record-name constructor-name predicate-name)}, where
811 @var{record-name}, @var{constructor-name}, and @var{predicate-name} are
812 all identifiers and specify the names to which, respectively, the
813 record-type descriptor, constructor, and predicate procedures will be
814 bound. If @var{name-spec} is only an identifier, it specifies the name
815 to which the generated record-type descriptor will be bound.
816
817 Each @var{record-clause} must be one of the following:
818
819 @itemize @bullet
820 @item
821 @code{(fields field-spec*)}, where each @var{field-spec} specifies a
822 field of the new record type and takes one of the following forms:
823 @itemize @bullet
824 @item
825 @code{(immutable field-name accessor-name)}, which specifies an
826 immutable field with the name @var{field-name} and binds an accessor
827 procedure for it to the name given by @var{accessor-name}
828 @item
829 @code{(mutable field-name accessor-name mutator-name)}, which specifies
830 a mutable field with the name @var{field-name} and binds accessor and
831 mutator procedures to @var{accessor-name} and @var{mutator-name},
832 respectively
833 @item
834 @code{(immutable field-name)}, which specifies an immutable field with
835 the name @var{field-name}; an accessor procedure for it will be created
836 and named by appending record name and @var{field-name} with a hyphen
837 separator
838 @item
839 @code{(mutable field-name}), which specifies a mutable field with the
840 name @var{field-name}; an accessor procedure for it will be created and
841 named as described above; a mutator procedure will also be created and
842 named by appending @code{-set!} to the accessor name
843 @item
844 @code{field-name}, which specifies an immutable field with the name
845 @var{field-name}; an access procedure for it will be created and named
846 as described above
847 @end itemize
848 @item
849 @code{(parent parent-name)}, where @var{parent-name} is a symbol giving
850 the name of the record type to be used as the parent of the new record
851 type
852 @item
853 @code{(protocol expression)}, where @var{expression} evaluates to a
854 protocol procedure which behaves as described above, and is used to
855 create a record constructor descriptor for the new record type
856 @item
857 @code{(sealed sealed?)}, where @var{sealed?} is a boolean value that
858 specifies whether or not the new record type is sealed
859 @item
860 @code{(opaque opaque?)}, where @var{opaque?} is a boolean value that
861 specifies whether or not the new record type is opaque
862 @item
863 @code{(nongenerative [uid])}, which specifies that the record type is
864 nongenerative via the optional uid @var{uid}. If @var{uid} is not
865 specified, a unique uid will be generated at expansion time
866 @item
867 @code{(parent-rtd parent-rtd parent-cd)}, a more explicit form of the
868 @code{parent} form above; @var{parent-rtd} and @var{parent-cd} should
869 evaluate to a record-type descriptor and a record constructor
870 descriptor, respectively
871 @end itemize
872 @end deffn
873
874 @deffn {Scheme Syntax} record-type-descriptor record-name
875 Evaluates to the record-type descriptor associated with the type
876 specified by @var{record-name}.
877 @end deffn
878
879 @deffn {Scheme Syntax} record-constructor-descriptor record-name
880 Evaluates to the record-constructor descriptor associated with the type
881 specified by @var{record-name}.
882 @end deffn
883
884 @node rnrs records procedural
885 @subsubsection rnrs records procedural
886
887 The @code{(rnrs records procedural (6))} library exports the procedural
888 API for working with R6RS records.
889
890 @deffn {Scheme Procedure} make-record-type-descriptor name parent uid sealed? opaque? fields
891 Returns a new record-type descriptor with the specified characteristics:
892 @var{name} must be a symbol giving the name of the new record type;
893 @var{parent} must be either @code{#f} or a non-sealed record-type
894 descriptor for the returned record type to extend; @var{uid} must be
895 either @code{#f}, indicating that the record type is generative, or
896 a symbol giving the type's nongenerative uid; @var{sealed?} and
897 @var{opaque?} must be boolean values that specify the sealedness and
898 opaqueness of the record type; @var{fields} must be a vector of zero or
899 more field specifiers of the form @code{(mutable name)} or
900 @code{(immutable name)}, where name is a symbol giving a name for the
901 field.
902
903 If @var{uid} is not @code{#f}, it must be a symbol
904 @end deffn
905
906 @deffn {Scheme Procedure} record-type-descriptor? obj
907 Returns @code{#t} if @var{obj} is a record-type descriptor, @code{#f}
908 otherwise.
909 @end deffn
910
911 @deffn {Scheme Procedure} make-record-constructor-descriptor rtd parent-constructor-descriptor protocol
912 Returns a new record constructor descriptor that can be used to produce
913 constructors for the record type specified by the record-type descriptor
914 @var{rtd} and whose delegation and binding behavior are specified by the
915 protocol procedure @var{protocol}.
916
917 @var{parent-constructor-descriptor} specifies a record constructor
918 descriptor for the parent type of @var{rtd}, if one exists. If
919 @var{rtd} represents a base type, then
920 @var{parent-constructor-descriptor} must be @code{#f}. If @var{rtd}
921 is an extension of another type, @var{parent-constructor-descriptor} may
922 still be @code{#f}, but protocol must also be @code{#f} in this case.
923 @end deffn
924
925 @deffn {Scheme Procedure} record-constructor rcd
926 Returns a record constructor procedure by invoking the protocol
927 defined by the record-constructor descriptor @var{rcd}.
928 @end deffn
929
930 @deffn {Scheme Procedure} record-predicate rtd
931 Returns the record predicate procedure for the record-type descriptor
932 @var{rtd}.
933 @end deffn
934
935 @deffn {Scheme Procedure} record-accessor rtd k
936 Returns the record field accessor procedure for the @var{k}th field of
937 the record-type descriptor @var{rtd}.
938 @end deffn
939
940 @deffn {Scheme Procedure} record-mutator rtd k
941 Returns the record field mutator procedure for the @var{k}th field of
942 the record-type descriptor @var{rtd}. An @code{&assertion} condition
943 will be raised if this field is not mutable.
944 @end deffn
945
946 @node rnrs records inspection
947 @subsubsection rnrs records inspection
948
949 The @code{(rnrs records inspection (6))} library provides procedures
950 useful for accessing metadata about R6RS records.
951
952 @deffn {Scheme Procedure} record? obj
953 Return @code{#t} if the specified object is a non-opaque R6RS record,
954 @code{#f} otherwise.
955 @end deffn
956
957 @deffn {Scheme Procedure} record-rtd record
958 Returns the record-type descriptor for @var{record}. An
959 @code{&assertion} is raised if @var{record} is opaque.
960 @end deffn
961
962 @deffn {Scheme Procedure} record-type-name rtd
963 Returns the name of the record-type descriptor @var{rtd}.
964 @end deffn
965
966 @deffn {Scheme Procedure} record-type-parent rtd
967 Returns the parent of the record-type descriptor @var{rtd}, or @code{#f}
968 if it has none.
969 @end deffn
970
971 @deffn {Scheme Procedure} record-type-uid rtd
972 Returns the uid of the record-type descriptor @var{rtd}, or @code{#f} if
973 it has none.
974 @end deffn
975
976 @deffn {Scheme Procedure} record-type-generative? rtd
977 Returns @code{#t} if the record-type descriptor @var{rtd} is generative,
978 @code{#f} otherwise.
979 @end deffn
980
981 @deffn {Scheme Procedure} record-type-sealed? rtd
982 Returns @code{#t} if the record-type descriptor @var{rtd} is sealed,
983 @code{#f} otherwise.
984 @end deffn
985
986 @deffn {Scheme Procedure} record-type-opaque? rtd
987 Returns @code{#t} if the record-type descriptor @var{rtd} is opaque,
988 @code{#f} otherwise.
989 @end deffn
990
991 @deffn {Scheme Procedure} record-type-field-names rtd
992 Returns a vector of symbols giving the names of the fields defined by
993 the record-type descriptor @var{rtd} (and not any of its sub- or
994 supertypes).
995 @end deffn
996
997 @deffn {Scheme Procedure} record-field-mutable? rtd k
998 Returns @code{#t} if the field at index @var{k} of the record-type
999 descriptor @var{rtd} (and not any of its sub- or supertypes) is mutable.
1000 @end deffn
1001
1002 @node rnrs exceptions
1003 @subsubsection rnrs exceptions
1004
1005 The @code{(rnrs exceptions (6))} library provides functionality related
1006 to signaling and handling exceptional situations. This functionality is
1007 similar to the exception handling systems provided by Guile's core
1008 library (@pxref{Exceptions}) and by the SRFI-18 and SRFI-34
1009 modules --- (@pxref{SRFI-18 Exceptions}) and (@pxref{SRFI-34}),
1010 respectively --- but there are some key differences in concepts and
1011 behavior.
1012
1013 A raised exception may be @dfn{continuable} or @dfn{non-continuable}.
1014 When an exception is raised non-continuably, another exception, with the
1015 condition type @code{&non-continuable}, will be raised when the
1016 exception handler returns locally. Raising an exception continuably
1017 captures the current continuation and invokes it after a local return
1018 from the exception handler.
1019
1020 Like SRFI-18 and SRFI-34, R6RS exceptions are implemented on top of
1021 Guile's native @code{throw} and @code{catch} forms, and use custom
1022 ``throw keys'' to identify their exception types. As a consequence,
1023 Guile's @code{catch} form can handle exceptions thrown by these APIs,
1024 but the reverse is not true: Handlers registered by the
1025 @code{with-exception-handler} procedure described below will only be
1026 called on exceptions thrown by the corresponding @code{raise} procedure.
1027
1028 @deffn {Scheme Procedure} with-exception-handler handler thunk
1029 Installs @var{handler}, which must be a procedure taking one argument,
1030 as the current exception handler during the invokation of @var{thunk}, a
1031 procedure taking zero arguments. The handler in place at the time
1032 @code{with-exception-handler} is called is made current again once
1033 either @var{thunk} returns or @var{handler} is invoked after an
1034 exception is thrown from within @var{thunk}.
1035
1036 This procedure is similar to the @code{with-throw-handler} procedure
1037 provided by Guile's code library; (@pxref{Throw Handlers}).
1038 @end deffn
1039
1040 @deffn {Scheme Syntax} guard (variable clause1 clause2 ...) body
1041 Evaluates the expression given by @var{body}, first creating an ad hoc
1042 exception handler that binds a raised exception to @var{variable} and
1043 then evaluates the specified @var{clause}s as if they were part of a
1044 @code{cond} expression (@pxref{if cond case}), with the value of the
1045 first matching clause becoming the value of the @code{guard} expression.
1046 If none of the clause's test expressions evaluates to @code{#t}, the
1047 exception is re-raised, with the exception handler that was current
1048 before the evaluation of the @code{guard} form.
1049
1050 For example, the expression
1051
1052 @lisp
1053 (guard (ex ((eq? ex 'foo) 'bar) ((eq? ex 'bar) 'baz))
1054 (raise 'bar))
1055 @end lisp
1056
1057 evaluates to @code{baz}.
1058 @end deffn
1059
1060 @deffn {Scheme Procedure} raise obj
1061 Raises a non-continuable exception by invoking the currently-installed
1062 exception handler on @var{obj}. If the handler returns, a
1063 @code{&non-continuable} exception will be raised in the dynamic context
1064 in which the handler was installed.
1065 @end deffn
1066
1067 @deffn {Scheme Procedure} raise-continuable obj
1068 Raises a continuable exception by invoking currently-installed exception
1069 handler on @var{obj}.
1070 @end deffn
1071
1072 @node rnrs conditions
1073 @subsubsection rnrs conditions
1074
1075 The @code{(rnrs condition (6))} library provides forms and procedures
1076 for constructing new condition types, as well as a library of
1077 pre-defined condition types that represent a variety of common
1078 exceptional situations. Conditions are records of a subtype of the
1079 @code{&condition} record type, which is neither sealed nor opaque.
1080 @xref{R6RS Records}.
1081
1082 Conditions may be manipulated singly, as @dfn{simple conditions}, or
1083 when composed with other conditions to form @dfn{compound conditions}.
1084 Compound conditions do not ``nest'' --- constructing a new compound
1085 condition out of existing compound conditions will ``flatten'' them
1086 into their component simple conditions. For example, making a new
1087 condition out of a @code{&message} condition and a compound condition
1088 that contains an @code{&assertion} condition and another @code{&message}
1089 condition will produce a compound condition that contains two
1090 @code{&message} conditions and one @code{&assertion} condition.
1091
1092 The record type predicates and field accessors described below can
1093 operate on either simple or compound conditions. In the latter case,
1094 the predicate returns @code{#t} if the compound condition contains a
1095 component simple condition of the appropriate type; the field accessors
1096 return the requisite fields from the first component simple condition
1097 found to be of the appropriate type.
1098
1099 @deffn &condition
1100 @deffnx condition? obj
1101 The base record type for conditions.
1102 @end deffn
1103
1104 @deffn {Scheme Procedure} condition condition1 ...
1105 @deffnx {Scheme Procedure} simple-conditions condition
1106 The @code{condition} procedure creates a new compound condition out of
1107 its condition arguments, flattening any specified compound conditions
1108 into their component simple conditions as described above.
1109
1110 @code{simple-conditions} returns a list of the component simple
1111 conditions of the compound condition @code{condition}, in the order in
1112 which they were specified at construction time.
1113 @end deffn
1114
1115 @deffn {Scheme Procedure} condition-predicate rtd
1116 @deffnx {Scheme Procedure} condition-accessor rtd proc
1117 These procedures return condition predicate and accessor procedures for
1118 the specified condition record type @var{rtd}.
1119 @end deffn
1120
1121 @deffn {Scheme Syntax} define-condition-type condition-type supertype constructor predicate field-spec ...
1122 Evaluates to a new record type definition for a condition type with the
1123 name @var{condition-type} that has the condition type @var{supertype} as
1124 its parent. A default constructor, which binds its arguments to the
1125 fields of this type and its parent types, will be bound to the
1126 identifier @var{constructor}; a condition predicate will be bound to
1127 @var{predicate}. The fields of the new type, which are immutable, are
1128 specified by the @var{field-spec}s, each of which must be of the form:
1129 @lisp
1130 (field accessor)
1131 @end lisp
1132 where @var{field} gives the name of the field and @var{accessor} gives
1133 the name for a binding to an accessor procedure created for this field.
1134 @end deffn
1135
1136 @deffn &message
1137 @deffnx {Scheme Procedure} make-message-condition message
1138 @deffnx {Scheme Procedure} message-condition? obj
1139 @deffnx {Scheme Procedure} condition-message condition
1140 A type that includes a message describing the condition that occurred.
1141 @end deffn
1142
1143 @deffn &warning
1144 @deffnx {Scheme Procedure} make-warning
1145 @deffnx {Scheme Procedure} warning? obj
1146 A base type for representing non-fatal conditions during execution.
1147 @end deffn
1148
1149 @deffn &serious
1150 @deffnx {Scheme Procedure} make-serious-condition
1151 @deffnx {Scheme Procedure} serious-condition? obj
1152 A base type for conditions representing errors serious enough that
1153 cannot be ignored.
1154 @end deffn
1155
1156 @deffn &error
1157 @deffnx {Scheme Procedure} make-error
1158 @deffnx {Scheme Procedure} error? obj
1159 A base type for conditions representing errors.
1160 @end deffn
1161
1162 @deffn &violation
1163 @deffnx {Scheme Procedure} make-violation
1164 @deffnx {Scheme Procedure} violation?
1165 A subtype of @code{&serious} that can be used to represent violations
1166 of a language or library standard.
1167 @end deffn
1168
1169 @deffn &assertion
1170 @deffnx {Scheme Procedure} make-assertion-violation
1171 @deffnx {Scheme Procedure} assertion-violation? obj
1172 A subtype of @code{&violation} that indicates an invalid call to a
1173 procedure.
1174 @end deffn
1175
1176 @deffn &irritants
1177 @deffnx {Scheme Procedure} make-irritants-condition irritants
1178 @deffnx {Scheme Procedure} irritants-condition? obj
1179 @deffnx {Scheme Procedure} condition-irritants condition
1180 A base type used for storing information about the causes of another
1181 condition in a compound condition.
1182 @end deffn
1183
1184 @deffn &who
1185 @deffnx {Scheme Procedure} make-who-condition who
1186 @deffnx {Scheme Procedure} who-condition? obj
1187 @deffnx {Scheme Procedure} condiction-who condition
1188 A base type used for storing the identity, a string or symbol, of the
1189 entity responsible for another condition in a compound condition.
1190 @end deffn
1191
1192 @deffn &non-continuable
1193 @deffnx {Scheme Procedure} make-non-continuable-violation
1194 @deffnx {Scheme Procedure} non-continuable-violation? obj
1195 A subtype of @code{&violation} used to indicate that an exception
1196 handler invoked by @code{raise} has returned locally.
1197 @end deffn
1198
1199 @deffn &implementation-restriction
1200 @deffnx {Scheme Procedure} make-implementation-restriction-violation
1201 @deffnx {Scheme Procedure} implementation-restriction-violation? obj
1202 A subtype of @code{&violation} used to indicate a violation of an
1203 implementation restriction.
1204 @end deffn
1205
1206 @deffn &lexical
1207 @deffnx {Scheme Procedure} make-lexical-violation
1208 @deffnx {Scheme Procedure} lexical-violation? obj
1209 A subtype of @code{&violation} used to indicate a syntax violation at
1210 the level of the datum syntax.
1211 @end deffn
1212
1213 @deffn &syntax
1214 @deffnx {Scheme Procedure} make-syntax-violation form subform
1215 @deffnx {Scheme Procedure} syntax-violation? obj
1216 @deffnx {Scheme Procedure} syntax-violation-form condition
1217 @deffnx {Scheme Procedure} syntax-violation-subform condition
1218 A subtype of @code{&violation} that indicates a syntax violation. The
1219 @var{form} and @var{subform} fields, which must be datum values,
1220 indicate the syntactic form responsible for the condition.
1221 @end deffn
1222
1223 @deffn &undefined
1224 @deffnx {Scheme Procedure} make-undefined-violation
1225 @deffnx {Scheme Procedure} undefined-violation? obj
1226 A subtype of @code{&violation} that indicates a reference to an unbound
1227 identifier.
1228 @end deffn
1229
1230 @node I/O Conditions
1231 @subsubsection I/O Conditions
1232
1233 These condition types are exported by both the
1234 @code{(rnrs io ports (6))} and @code{(rnrs io simple (6))} libraries.
1235
1236 @deffn &i/o
1237 @deffnx {Scheme Procedure} make-i/o-error
1238 @deffnx {Scheme Procedure} i/o-error? obj
1239 A condition supertype for more specific I/O errors.
1240 @end deffn
1241
1242 @deffn &i/o-read
1243 @deffnx {Scheme Procedure} make-i/o-read-error
1244 @deffnx {Scheme Procedure} i/o-read-error? obj
1245 A subtype of @code{&i/o}; represents read-related I/O errors.
1246 @end deffn
1247
1248 @deffn &i/o-write
1249 @deffnx {Scheme Procedure} make-i/o-write-error
1250 @deffnx {Scheme Procedure} i/o-write-error? obj
1251 A subtype of @code{&i/o}; represents write-related I/O errors.
1252 @end deffn
1253
1254 @deffn &i/o-invalid-position
1255 @deffnx {Scheme Procedure} make-i/o-invalid-position-error position
1256 @deffnx {Scheme Procedure} i/o-invalid-position-error? obj
1257 @deffnx {Scheme Procedure} i/o-error-position condition
1258 A subtype of @code{&i/o}; represents an error related to an attempt to
1259 set the file position to an invalid position.
1260 @end deffn
1261
1262 @deffn &i/o-filename
1263 @deffnx {Scheme Procedure} make-io-filename-error filename
1264 @deffnx {Scheme Procedure} i/o-filename-error? obj
1265 @deffnx {Scheme Procedure} i/o-error-filename condition
1266 A subtype of @code{&i/o}; represents an error related to an operation on
1267 a named file.
1268 @end deffn
1269
1270 @deffn &i/o-file-protection
1271 @deffnx {Scheme Procedure} make-i/o-file-protection-error filename
1272 @deffnx {Scheme Procedure} i/o-file-protection-error? obj
1273 A subtype of @code{&i/o-filename}; represents an error resulting from an
1274 attempt to access a named file for which the caller had insufficient
1275 permissions.
1276 @end deffn
1277
1278 @deffn &i/o-file-is-read-only
1279 @deffnx {Scheme Procedure} make-i/o-file-is-read-only-error filename
1280 @deffnx {Scheme Procedure} i/o-file-is-read-only-error? obj
1281 A subtype of @code{&i/o-file-protection}; represents an error related to
1282 an attempt to write to a read-only file.
1283 @end deffn
1284
1285 @deffn &i/o-file-already-exists
1286 @deffnx {Scheme Procedure} make-i/o-file-already-exists-error filename
1287 @deffnx {Scheme Procedure} i/o-file-already-exists-error? obj
1288 A subtype of @code{&i/o-filename}; represents an error related to an
1289 operation on an existing file that was assumed not to exist.
1290 @end deffn
1291
1292 @deffn &i/o-file-does-not-exist
1293 @deffnx {Scheme Procedure} make-i/o-file-does-not-exist-error
1294 @deffnx {Scheme Procedure} i/o-file-does-not-exist-error? obj
1295 A subtype of @code{&i/o-filename}; represents an error related to an
1296 operation on a non-existent file that was assumed to exist.
1297 @end deffn
1298
1299 @deffn &i/o-port
1300 @deffnx {Scheme Procedure} make-i/o-port-error port
1301 @deffnx {Scheme Procedure} i/o-port-error? obj
1302 @deffnx {Scheme Procedure} i/o-error-port condition
1303 A subtype of @code{&i/o}; represents an error related to an operation on
1304 the port @var{port}.
1305 @end deffn
1306
1307 @node rnrs io ports
1308 @subsubsection rnrs io ports
1309
1310 The @code{(rnrs io ports (6))} library provides various procedures and
1311 syntactic forms for use in writing to and reading from ports. This
1312 functionality is documented in its own section of the manual;
1313 (@pxref{R6RS I/O Ports}).
1314
1315 @node rnrs io simple
1316 @subsubsection rnrs io simple
1317
1318 The @code{(rnrs io simple (6))} library provides convenience functions
1319 for performing textual I/O on ports. This library also exports all of
1320 the condition types and associated procedures described in
1321 (@pxref{I/O Conditions}).
1322
1323 @deffn {Scheme Procedure} eof-object
1324 @deffnx {Scheme Procedure} eof-object? obj
1325 These procedures are identical to the ones provided by the
1326 @code{(rnrs io ports (6))} library. @xref{R6RS I/O Ports}, for
1327 documentation.
1328 @end deffn
1329
1330 @deffn {Scheme Procedure} input-port? obj
1331 @deffnx {Scheme Procedure} output-port? obj
1332 These procedures are identical to the ones provided by Guile's core
1333 library. @xref{Ports}, for documentation.
1334 @end deffn
1335
1336 @deffn {Scheme Procedure} call-with-input-file filename proc
1337 @deffnx {Scheme Procedure} call-with-output-file filename proc
1338 @deffnx {Scheme Procedure} open-input-file filename
1339 @deffnx {Scheme Procedure} open-output-file filename
1340 @deffnx {Scheme Procedure} with-input-from-file filename thunk
1341 @deffnx {Scheme Procedure} with-output-to-file filename thunk
1342 These procedures are identical to the ones provided by Guile's core
1343 library. @xref{File Ports}, for documentation.
1344 @end deffn
1345
1346 @deffn {Scheme Procedure} close-input-port input-port
1347 @deffnx {Scheme Procedure} close-output-port output-port
1348 These procedures are identical to the ones provided by Guile's core
1349 library. @xref{Closing}, for documentation.
1350 @end deffn
1351
1352 @deffn {Scheme Procedure} peek-char
1353 @deffnx {Scheme Procedure} peek-char textual-input-port
1354 @deffnx {Scheme Procedure} read-char
1355 @deffnx {Scheme Procedure} read-char textual-input-port
1356 These procedures are identical to the ones provided by Guile's core
1357 library. @xref{Reading}, for documentation.
1358 @end deffn
1359
1360 @deffn {Scheme Procedure} read
1361 @deffnx {Scheme Procedure} read textual-input-port
1362 This procedure is identical to the one provided by Guile's core library.
1363 @xref{Scheme Read}, for documentation.
1364 @end deffn
1365
1366 @deffn {Scheme Procedure} display obj
1367 @deffnx {Scheme Procedure} display obj textual-output-port
1368 @deffnx {Scheme Procedure} newline
1369 @deffnx {Scheme Procedure} newline textual-output-port
1370 @deffnx {Scheme Procedure} write obj
1371 @deffnx {Scheme Procedure} write obj textual-output-port
1372 @deffnx {Scheme Procedure} write-char char
1373 @deffnx {Scheme Procedure} write-char char textual-output-port
1374 These procedures are identical to the ones provided by Guile's core
1375 library. @xref{Writing}, for documentation.
1376 @end deffn
1377
1378 @node rnrs files
1379 @subsubsection rnrs files
1380
1381 The @code{(rnrs files (6))} library provides the @code{file-exists?} and
1382 @code{delete-file} procedures, which test for the existence of a file
1383 and allow the deletion of files from the filesystem, respectively.
1384
1385 These procedures are identical to the ones provided by Guile's core
1386 library. @xref{File System}, for documentation.
1387
1388 @node rnrs programs
1389 @subsubsection rnrs programs
1390
1391 The @code{(rnrs programs (6))} library provides procedures for
1392 process management and introspection.
1393
1394 @deffn {Scheme Procedure} command-line
1395 This procedure is identical to the one provided by Guile's core library.
1396 @xref{Runtime Environment}, for documentation.
1397 @end deffn
1398
1399 @deffn {Scheme Procedure} exit
1400 @deffnx {Scheme Procedure} exit obj
1401 This procedure is identical to the one provided by Guile's core library.
1402 @end deffn
1403
1404 @node rnrs arithmetic fixnums
1405 @subsubsection rnrs arithmetic fixnums
1406
1407 The @code{(rnrs arithmetic fixnums (6))} library provides procedures for
1408 performing arithmetic operations on an implementation-dependent range of
1409 exact integer values, which R6RS refers to as @dfn{fixnums}. In Guile,
1410 the size of a fixnum is determined by the size of the @code{SCM} type; a
1411 single SCM struct is guaranteed to be able to hold an entire fixnum,
1412 making fixnum computations particularly efficient ---
1413 (@pxref{The SCM Type}). On 32-bit systems, the most negative and most
1414 positive fixnum values are, respectively, -536870912 and 536870911.
1415
1416 Unless otherwise specified, all of the procedures below take fixnums as
1417 arguments, and will raise an @code{&assertion} condition if passed a
1418 non-fixnum argument or an @code{&implementation-restriction} condition
1419 if their result is not itself a fixnum.
1420
1421 @deffn {Scheme Procedure} fixnum? obj
1422 Returns @code{#t} if @var{obj} is a fixnum, @code{#f} otherwise.
1423 @end deffn
1424
1425 @deffn {Scheme Procedure} fixnum-width
1426 @deffnx {Scheme Procedure} least-fixnum
1427 @deffnx {Scheme Procedure} greatest-fixnum
1428 These procedures return, respectively, the maximum number of bits
1429 necessary to represent a fixnum value in Guile, the minimum fixnum
1430 value, and the maximum fixnum value.
1431 @end deffn
1432
1433 @deffn {Scheme Procedure} fx=? fx1 fx2 fx3 ...
1434 @deffnx {Scheme Procedure} fx>? fx1 fx2 fx3 ...
1435 @deffnx {Scheme Procedure} fx<? fx1 fx2 fx3 ...
1436 @deffnx {Scheme Procedure} fx>=? fx1 fx2 fx3 ...
1437 @deffnx {Scheme Procedure} fx<=? fx1 fx2 fx3 ...
1438 These procedures return @code{#t} if their fixnum arguments are
1439 (respectively): equal, monotonically increasing, monotonically
1440 decreasing, monotonically nondecreasing, or monotonically nonincrasing;
1441 @code{#f} otherwise.
1442 @end deffn
1443
1444 @deffn {Scheme Procedure} fxzero? fx
1445 @deffnx {Scheme Procedure} fxpositive? fx
1446 @deffnx {Scheme Procedure} fxnegative? fx
1447 @deffnx {Scheme Procedure} fxodd? fx
1448 @deffnx {Scheme Procedure} fxeven? fx
1449 These numerical predicates return @code{#t} if @var{fx} is,
1450 respectively, zero, greater than zero, less than zero, odd, or even;
1451 @code{#f} otherwise.
1452 @end deffn
1453
1454 @deffn {Scheme Procedure} fxmax fx1 fx2 ...
1455 @deffnx {Scheme Procedure} fxmin fx1 fx2 ...
1456 These procedures return the maximum or minimum of their arguments.
1457 @end deffn
1458
1459 @deffn {Scheme Procedure} fx+ fx1 fx2
1460 @deffnx {Scheme Procedure} fx* fx1 fx2
1461 These procedures return the sum or product of their arguments.
1462 @end deffn
1463
1464 @deffn {Scheme Procedure} fx- fx1 fx2
1465 @deffnx {Scheme Procedure} fx- fx
1466 Returns the difference of @var{fx1} and @var{fx2}, or the negation of
1467 @var{fx}, if called with a single argument.
1468
1469 An @code{&assertion} condition is raised if the result is not itself a
1470 fixnum.
1471 @end deffn
1472
1473 @deffn {Scheme Procedure} fxdiv-and-mod fx1 fx2
1474 @deffnx {Scheme Procedure} fxdiv fx1 fx2
1475 @deffnx {Scheme Procedure} fxmod fx1 fx2
1476 @deffnx {Scheme Procedure} fxdiv0-and-mod0 fx1 fx2
1477 @deffnx {Scheme Procedure} fxdiv0 fx1 fx2
1478 @deffnx {Scheme Procedure} fxmod0 fx1 fx2
1479 These procedures implement number-theoretic division on fixnums;
1480 (@pxref{(rnrs base)}) for a description for their semantics.
1481 @end deffn
1482
1483 @deffn {Scheme Procedure} fx+/carry fx1 fx2 fx3
1484 Returns the two fixnum results of the following computation:
1485 @lisp
1486 (let* ((s (+ fx1 fx2 fx3))
1487 (s0 (mod0 s (expt 2 (fixnum-width))))
1488 (s1 (div0 s (expt 2 (fixnum-width)))))
1489 (values s0 s1))
1490 @end lisp
1491 @end deffn
1492
1493 @deffn {Scheme Procedure} fx-/carry fx1 fx2 fx3
1494 Returns the two fixnum results of the following computation:
1495 @lisp
1496 (let* ((d (- fx1 fx2 fx3))
1497 (d0 (mod0 d (expt 2 (fixnum-width))))
1498 (d1 (div0 d (expt 2 (fixnum-width)))))
1499 (values d0 d1))
1500 @end lisp
1501 @end deffn
1502
1503 @deffn {Scheme Procedure} fx*/carry fx1 fx2 fx3
1504 @lisp
1505 Returns the two fixnum results of the following computation:
1506 (let* ((s (+ (* fx1 fx2) fx3))
1507 (s0 (mod0 s (expt 2 (fixnum-width))))
1508 (s1 (div0 s (expt 2 (fixnum-width)))))
1509 (values s0 s1))
1510 @end lisp
1511 @end deffn
1512
1513 @deffn {Scheme Procedure} fxnot fx
1514 @deffnx {Scheme Procedure} fxand fx1 ...
1515 @deffnx {Scheme Procedure} fxior fx1 ...
1516 @deffnx {Scheme Procedure} fxxor fx1 ...
1517 These procedures are identical to the @code{lognot}, @code{logand},
1518 @code{logior}, and @code{logxor} procedures provided by Guile's core
1519 library. @xref{Bitwise Operations}, for documentation.
1520 @end deffn
1521
1522 @deffn {Scheme Procedure} fxif fx1 fx2 fx3
1523 Returns the bitwise ``if'' of its fixnum arguments. The bit at position
1524 @code{i} in the return value will be the @code{i}th bit from @var{fx2}
1525 if the @code{i}th bit of @var{fx1} is 1, the @code{i}th bit from
1526 @var{fx3}.
1527 @end deffn
1528
1529 @deffn {Scheme Procedure} fxbit-count fx
1530 Returns the number of 1 bits in the two's complement representation of
1531 @var{fx}.
1532 @end deffn
1533
1534 @deffn {Scheme Procedure} fxlength fx
1535 Returns the number of bits necessary to represent @var{fx}.
1536 @end deffn
1537
1538 @deffn {Scheme Procedure} fxfirst-bit-set fx
1539 Returns the index of the least significant 1 bit in the two's complement
1540 representation of @var{fx}.
1541 @end deffn
1542
1543 @deffn {Scheme Procedure} fxbit-set? fx1 fx2
1544 Returns @code{#t} if the @var{fx2}th bit in the two's complement
1545 representation of @var{fx1} is 1, @code{#f} otherwise.
1546 @end deffn
1547
1548 @deffn {Scheme Procedure} fxcopy-bit fx1 fx2 fx3
1549 Returns the result of setting the @var{fx2}th bit of @var{fx1} to the
1550 @var{fx2}th bit of @var{fx3}.
1551 @end deffn
1552
1553 @deffn {Scheme Procedure} fxbit-field fx1 fx2 fx3
1554 Returns the integer representation of the contiguous sequence of bits in
1555 @var{fx1} that starts at position @var{fx2} (inclusive) and ends at
1556 position @var{fx3} (exclusive).
1557 @end deffn
1558
1559 @deffn {Scheme Procedure} fxcopy-bit-field fx1 fx2 fx3 fx4
1560 Returns the result of replacing the bit field in @var{fx1} with start
1561 and end positions @var{fx2} and @var{fx3} with the corresponding bit
1562 field from @var{fx4}.
1563 @end deffn
1564
1565 @deffn {Scheme Procedure} fxarithmetic-shift fx1 fx2
1566 @deffnx {Scheme Procedure} fxarithmetic-shift-left fx1 fx2
1567 @deffnx {Scheme Procedure} fxarithmetic-shift-right fx1 fx2
1568 Returns the result of shifting the bits of @var{fx1} right or left by
1569 the @var{fx2} positions. @code{fxarithmetic-shift} is identical
1570 to @code{fxarithmetic-shift-left}.
1571 @end deffn
1572
1573 @deffn {Scheme Procedure} fxrotate-bit-field fx1 fx2 fx3 fx4
1574 Returns the result of cyclically permuting the bit field in @var{fx1}
1575 with start and end positions @var{fx2} and @var{fx3} by @var{fx4} bits
1576 in the direction of more significant bits.
1577 @end deffn
1578
1579 @deffn {Scheme Procedure} fxreverse-bit-field fx1 fx2 fx3
1580 Returns the result of reversing the order of the bits of @var{fx1}
1581 between position @var{fx2} (inclusive) and position @var{fx3}
1582 (exclusive).
1583 @end deffn
1584
1585 @node rnrs arithmetic flonums
1586 @subsubsection rnrs arithmetic flonums
1587
1588 The @code{(rnrs arithmetic flonums (6))} library provides procedures for
1589 performing arithmetic operations on inexact representations of real
1590 numbers, which R6RS refers to as @dfn{flonums}.
1591
1592 Unless otherwise specified, all of the procedures below take flonums as
1593 arguments, and will raise an @code{&assertion} condition if passed a
1594 non-flonum argument.
1595
1596 @deffn {Scheme Procedure} flonum? obj
1597 Returns @code{#t} if @var{obj} is a flonum, @code{#f} otherwise.
1598 @end deffn
1599
1600 @deffn {Scheme Procedure} real->flonum x
1601 Returns the flonum that is numerically closest to the real number
1602 @var{x}.
1603 @end deffn
1604
1605 @deffn {Scheme Procedure} fl=? fl1 fl2 fl3 ...
1606 @deffnx {Scheme Procedure} fl<? fl1 fl2 fl3 ...
1607 @deffnx {Scheme Procedure} fl<=? fl1 fl2 fl3 ...
1608 @deffnx {Scheme Procedure} fl>? fl1 fl2 fl3 ...
1609 @deffnx {Scheme Procedure} fl>=? fl1 fl2 fl3 ...
1610 These procedures return @code{#t} if their flonum arguments are
1611 (respectively): equal, monotonically increasing, monotonically
1612 decreasing, monotonically nondecreasing, or monotonically nonincrasing;
1613 @code{#f} otherwise.
1614 @end deffn
1615
1616 @deffn {Scheme Procedure} flinteger? fl
1617 @deffnx {Scheme Procedure} flzero? fl
1618 @deffnx {Scheme Procedure} flpositive? fl
1619 @deffnx {Scheme Procedure} flnegative? fl
1620 @deffnx {Scheme Procedure} flodd? fl
1621 @deffnx {Scheme Procedure} fleven? fl
1622 These numerical predicates return @code{#t} if @var{fl} is,
1623 respectively, an integer, zero, greater than zero, less than zero, odd,
1624 even, @code{#f} otherwise. In the case of @code{flodd?} and
1625 @code{fleven?}, @var{fl} must be an integer-valued flonum.
1626 @end deffn
1627
1628 @deffn {Scheme Procedure} flfinite? fl
1629 @deffnx {Scheme Procedure} flinfinite? fl
1630 @deffnx {Scheme Procedure} flnan? fl
1631 These numerical predicates return @code{#t} if @var{fl} is,
1632 respectively, not infinite, infinite, or a @code{NaN} value.
1633 @end deffn
1634
1635 @deffn {Scheme Procedure} flmax fl1 fl2 ...
1636 @deffnx {Scheme Procedure} flmin fl1 fl2 ...
1637 These procedures return the maximum or minimum of their arguments.
1638 @end deffn
1639
1640 @deffn {Scheme Procedure} fl+ fl1 ...
1641 @deffnx {Scheme Procedure} fl* fl ...
1642 These procedures return the sum or product of their arguments.
1643 @end deffn
1644
1645 @deffn {Scheme Procedure} fl- fl1 fl2 ...
1646 @deffnx {Scheme Procedure} fl- fl
1647 @deffnx {Scheme Procedure} fl/ fl1 fl2 ...
1648 @deffnx {Scheme Procedure} fl/ fl
1649 These procedures return, respectively, the difference or quotient of
1650 their arguments when called with two arguments; when called with a
1651 single argument, they return the additive or multiplicative inverse of
1652 @var{fl}.
1653 @end deffn
1654
1655 @deffn {Scheme Procedure} flabs fl
1656 Returns the absolute value of @var{fl}.
1657 @end deffn
1658
1659 @deffn {Scheme Procedure} fldiv-and-mod fl1 fl2
1660 @deffnx {Scheme Procedure} fldiv fl1 fl2
1661 @deffnx {Scheme Procedure} fldmod fl1 fl2
1662 @deffnx {Scheme Procedure} fldiv0-and-mod0 fl1 fl2
1663 @deffnx {Scheme Procedure} fldiv0 fl1 fl2
1664 @deffnx {Scheme Procedure} flmod0 fl1 fl2
1665 These procedures implement number-theoretic division on flonums;
1666 (@pxref{(rnrs base)}) for a description for their semantics.
1667 @end deffn
1668
1669 @deffn {Scheme Procedure} flnumerator fl
1670 @deffnx {Scheme Procedure} fldenominator fl
1671 These procedures return the numerator or denominator of @var{fl} as a
1672 flonum.
1673 @end deffn
1674
1675 @deffn {Scheme Procedure} flfloor fl1
1676 @deffnx {Scheme Procedure} flceiling fl
1677 @deffnx {Scheme Procedure} fltruncate fl
1678 @deffnx {Scheme Procedure} flround fl
1679 These procedures are identical to the @code{floor}, @code{ceiling},
1680 @code{truncate}, and @code{round} procedures provided by Guile's core
1681 library. @xref{Arithmetic}, for documentation.
1682 @end deffn
1683
1684 @deffn {Scheme Procedure} flexp fl
1685 @deffnx {Scheme Procedure} fllog fl
1686 @deffnx {Scheme Procedure} fllog fl1 fl2
1687 @deffnx {Scheme Procedure} flsin fl
1688 @deffnx {Scheme Procedure} flcos fl
1689 @deffnx {Scheme Procedure} fltan fl
1690 @deffnx {Scheme Procedure} flasin fl
1691 @deffnx {Scheme Procedure} flacos fl
1692 @deffnx {Scheme Procedure} flatan fl
1693 @deffnx {Scheme Procedure} flatan fl1 fl2
1694 These procedures, which compute the usual transcendental functions, are
1695 the flonum variants of the procedures provided by the R6RS base library
1696 (@pxref{(rnrs base)}).
1697 @end deffn
1698
1699 @deffn {Scheme Procedure} flsqrt fl
1700 Returns the square root of @var{fl}. If @var{fl} is @code{-0.0},
1701 @var{-0.0} is returned; for other negative values, a @code{NaN} value
1702 is returned.
1703 @end deffn
1704
1705 @deffn {Scheme Procedure} flexpt fl1 fl2
1706 Returns the value of @var{fl1} raised to the power of @var{fl2}.
1707 @end deffn
1708
1709 The following condition types are provided to allow Scheme
1710 implementations that do not support infinities or @code{NaN} values
1711 to indicate that a computation resulted in such a value. Guile supports
1712 both of these, so these conditions will never be raised by Guile's
1713 standard libraries implementation.
1714
1715 @deffn &no-infinities
1716 @deffnx {Scheme Procedure} make-no-infinities-violation obj
1717 @deffnx {Scheme Procedure} no-infinities-violation?
1718 A condition type indicating that a computation resulted in an infinite
1719 value on a Scheme implementation incapable of representing infinities.
1720 @end deffn
1721
1722 @deffn &no-nans
1723 @deffnx {Scheme Procedure} make-no-nans-violation obj
1724 @deffnx {Scheme Procedure} no-nans-violation? obj
1725 A condition type indicating that a computation resulted in a @code{NaN}
1726 value on a Scheme implementation incapable of representing @code{NaN}s.
1727 @end deffn
1728
1729 @deffn {Scheme Procedure} fixnum->flonum fx
1730 Returns the flonum that is numerically closest to the fixnum @var{fx}.
1731 @end deffn
1732
1733 @node rnrs arithmetic bitwise
1734 @subsubsection rnrs arithmetic bitwise
1735
1736 The @code{(rnrs arithmetic bitwise (6))} library provides procedures for
1737 performing bitwise arithmetic operations on the two's complement
1738 representations of fixnums.
1739
1740 @deffn {Scheme Procedure} bitwise-not ei
1741 @deffnx {Scheme Procedure} bitwise-and ei1 ...
1742 @deffnx {Scheme Procedure} bitwise-ior ei1 ...
1743 @deffnx {Scheme Procedure} bitwise-xor ei1 ...
1744 These procedures are identical to the @code{lognot}, @code{logand},
1745 @code{logior}, and @code{logxor} procedures provided by Guile's core
1746 library. @xref{Bitwise Operations}, for documentation.
1747 @end deffn
1748
1749 @deffn {Scheme Procedure} bitwise-if ei1 ei2 ei3
1750 Returns the bitwise ``if'' of its arguments. The bit at position
1751 @code{i} in the return value will be the @code{i}th bit from @var{ei2}
1752 if the @code{i}th bit of @var{ei1} is 1, the @code{i}th bit from
1753 @var{ei3}.
1754 @end deffn
1755
1756 @deffn {Scheme Procedure} bitwise-bit-count ei
1757 Returns the number of 1 bits in the two's complement representation of
1758 @var{ei}.
1759 @end deffn
1760
1761 @deffn {Scheme Procedure} bitwise-length ei
1762 Returns the number of bits necessary to represent @var{ei}.
1763 @end deffn
1764
1765 @deffn {Scheme Procedure} bitwise-first-bit-set ei
1766 Returns the index of the least significant 1 bit in the two's complement
1767 representation of @var{ei}.
1768 @end deffn
1769
1770 @deffn {Scheme Procedure} bitwise-bit-set? ei1 ei2
1771 Returns @code{#t} if the @var{ei2}th bit in the two's complement
1772 representation of @var{ei1} is 1, @code{#f} otherwise.
1773 @end deffn
1774
1775 @deffn {Scheme Procedure} bitwise-copy-bit ei1 ei2 ei3
1776 Returns the result of setting the @var{ei2}th bit of @var{ei1} to the
1777 @var{ei2}th bit of @var{ei3}.
1778 @end deffn
1779
1780 @deffn {Scheme Procedure} bitwise-bit-field ei1 ei2 ei3
1781 Returns the integer representation of the contiguous sequence of bits in
1782 @var{ei1} that starts at position @var{ei2} (inclusive) and ends at
1783 position @var{ei3} (exclusive).
1784 @end deffn
1785
1786 @deffn {Scheme Procedure} bitwise-copy-bit-field ei1 ei2 ei3 ei4
1787 Returns the result of replacing the bit field in @var{ei1} with start
1788 and end positions @var{ei2} and @var{ei3} with the corresponding bit
1789 field from @var{ei4}.
1790 @end deffn
1791
1792 @deffn {Scheme Procedure} bitwise-arithmetic-shift ei1 ei2
1793 @deffnx {Scheme Procedure} bitwise-arithmetic-shift-left ei1 ei2
1794 @deffnx {Scheme Procedure} bitwise-arithmetic-shift-right ei1 ei2
1795 Returns the result of shifting the bits of @var{ei1} right or left by
1796 the @var{ei2} positions. @code{bitwise-arithmetic-shift} is identical
1797 to @code{bitwise-arithmetic-shift-left}.
1798 @end deffn
1799
1800 @deffn {Scheme Procedure} bitwise-rotate-bit-field ei1 ei2 ei3 ei4
1801 Returns the result of cyclically permuting the bit field in @var{ei1}
1802 with start and end positions @var{ei2} and @var{ei3} by @var{ei4} bits
1803 in the direction of more significant bits.
1804 @end deffn
1805
1806 @deffn {Scheme Procedure} bitwise-reverse-bit-field ei1 ei2 ei3
1807 Returns the result of reversing the order of the bits of @var{e1}
1808 between position @var{ei2} (inclusive) and position @var{ei3}
1809 (exclusive).
1810 @end deffn
1811
1812 @node rnrs syntax-case
1813 @subsubsection rnrs syntax-case
1814
1815 The @code{(rnrs syntax-case (6))} library provides access to the
1816 @code{syntax-case} system for writing hygienic macros. With one
1817 exception, all of the forms and procedures exported by this library
1818 are ``re-exports'' of Guile's native support for @code{syntax-case};
1819 (@pxref{Syntax Case}) for documentation, examples, and rationale.
1820
1821 @deffn {Scheme Procedure} make-variable-transformer proc
1822 Creates a new variable transformer out of @var{proc}, a procedure that
1823 takes a syntax object as input and returns a syntax object. If an
1824 identifier to which the result of this procedure is bound appears on the
1825 left-hand side of a @code{set!} expression, @var{proc} will be called
1826 with a syntax object representing the entire @code{set!} expression,
1827 and its return value will replace that @code{set!} expression.
1828 @end deffn
1829
1830 @deffn {Scheme Syntax} syntax-case expression (literal ...) clause ...
1831 The @code{syntax-case} pattern matching form.
1832 @end deffn
1833
1834 @deffn {Scheme Syntax} syntax template
1835 @deffnx {Scheme Syntax} quasisyntax template
1836 @deffnx {Scheme Syntax} unsyntax template
1837 @deffnx {Scheme Syntax} unsyntax-splicing template
1838 These forms allow references to be made in the body of a syntax-case
1839 output expression subform to datum and non-datum values. They are
1840 identical to the forms provided by Guile's core library;
1841 (@pxref{Syntax Case}) for documentation.
1842 @end deffn
1843
1844 @deffn {Scheme Procedure} identifier? obj
1845 @deffnx {Scheme Procedure} bound-identifier=? id1 id2
1846 @deffnx {Scheme Procedure} free-identifier=? id1 id2
1847 These predicate procedures operate on syntax objects representing
1848 Scheme identifiers. @code{identifier?} returns @code{#t} if @var{obj}
1849 represents an identifier, @code{#f} otherwise.
1850 @code{bound-identifier=?} returns @code{#t} if and only if a binding for
1851 @var{id1} would capture a reference to @var{id2} in the transformer's
1852 output, or vice-versa. @code{free-identifier=?} returns @code{#t} if
1853 and only @var{id1} and @var{id2} would refer to the same binding in the
1854 output of the transformer, independent of any bindings introduced by the
1855 transformer.
1856 @end deffn
1857
1858 @deffn {Scheme Procedure} generate-temporaries l
1859 Returns a list, of the same length as @var{l}, which must be a list or
1860 a syntax object representing a list, of globally unique symbols.
1861 @end deffn
1862
1863 @deffn {Scheme Procedure} syntax->datum syntax-object
1864 @deffnx {Scheme Procedure} datum->syntax template-id datum
1865 These procedures convert wrapped syntax objects to and from Scheme datum
1866 values. The syntax object returned by @code{datum->syntax} shares
1867 contextual information with the syntax object @var{template-id}.
1868 @end deffn
1869
1870 @deffn {Scheme Procedure} syntax-violation whom message form
1871 @deffnx {Scheme Procedure} syntax-violation whom message form subform
1872 Constructs a new compound condition that includes the following
1873 simple conditions:
1874 @itemize @bullet
1875 @item
1876 If @var{whom} is not @code{#f}, a @code{&who} condition with the
1877 @var{whom} as its field
1878 @item
1879 A @code{&message} condition with the specified @var{message}
1880 @item
1881 A @code{&syntax} condition with the specified @var{form} and optional
1882 @var{subform} fields
1883 @end itemize
1884 @end deffn
1885
1886 @node rnrs hashtables
1887 @subsubsection rnrs hashtables
1888
1889 The @code{(rnrs hashtables (6))} library provides structures and
1890 procedures for creating and accessing hash tables. The hash tables API
1891 defined by R6RS is substantially similar to both Guile's native hash
1892 tables implementation (@pxref{Hash Tables}) as well as the one
1893 provided by SRFI-69 (@pxref{SRFI-69}). Note that you can write
1894 portable R6RS library code that manipulates SRFI-69 hash tables (by
1895 importing the @code{(srfi :69)} library); however, hash tables created
1896 by one API cannot be used by another.
1897
1898 Like SRFI-69 hash tables --- and unlike Guile's native ones --- R6RS
1899 hash tables associate hash and equality functions with a hash table at
1900 the time of its creation. Additionally, R6RS allows for the creation
1901 (via @code{hashtable-copy}; see below) of immutable hash tables.
1902
1903 @deffn {Scheme Procedure} make-eq-hashtable
1904 @deffnx {Scheme Procedure} make-eq-hashtable k
1905 Returns a new hash table that uses @code{eq?} to compare keys and
1906 Guile's @code{hashq} procedure as a hash function. If @var{k} is given,
1907 it specifies the initial capacity of the hash table.
1908 @end deffn
1909
1910 @deffn {Scheme Procedure} make-eqv-hashtable
1911 @deffnx {Scheme Procedure} make-eqv-hashtable k
1912 Returns a new hash table that uses @code{eqv?} to compare keys and
1913 Guile's @code{hashv} procedure as a hash function. If @var{k} is given,
1914 it specifies the initial capacity of the hash table.
1915 @end deffn
1916
1917 @deffn {Scheme Procedure} make-hashtable hash-function equiv
1918 @deffnx {Scheme Procedure} make-hashtable hash-function equiv k
1919 Returns a new hash table that uses @var{equiv} to compare keys and
1920 @var{hash-function} as a hash function. @var{equiv} must be a procedure
1921 that accepts two arguments and returns a true value if they are
1922 equivalent, @code{#f} otherwise; @var{hash-function} must be a procedure
1923 that accepts one argument and returns a non-negative integer.
1924
1925 If @var{k} is given, it specifies the initial capacity of the hash
1926 table.
1927 @end deffn
1928
1929 @deffn {Scheme Procedure} hashtable? obj
1930 Returns @code{#t} if @var{obj} is an R6RS hash table, @code{#f}
1931 otherwise.
1932 @end deffn
1933
1934 @deffn {Scheme Procedure} hashtable-size hashtable
1935 Returns the number of keys currently in the hash table @var{hashtable}.
1936 @end deffn
1937
1938 @deffn {Scheme Procedure} hashtable-ref hashtable key default
1939 Returns the value associated with @var{key} in the hash table
1940 @var{hashtable}, or @var{default} if none is found.
1941 @end deffn
1942
1943 @deffn {Scheme Procedure} hashtable-set! hashtable key obj
1944 Associates the key @var{key} with the value @var{obj} in the hash table
1945 @var{hashtable}, and returns an unspecified value. An @code{&assertion}
1946 condition is raised if @var{hashtable} is immutable.
1947 @end deffn
1948
1949 @deffn {Scheme Procedure} hashtable-delete! hashtable key
1950 Removes any association found for the key @var{key} in the hash table
1951 @var{hashtable}, and returns an unspecified value. An @code{&assertion}
1952 condition is raised if @var{hashtable} is immutable.
1953 @end deffn
1954
1955 @deffn {Scheme Procedure} hashtable-contains? hashtable key
1956 Returns @code{#t} if the hash table @var{hashtable} contains an
1957 association for the key @var{key}, @code{#f} otherwise.
1958 @end deffn
1959
1960 @deffn {Scheme Procedure} hashtable-update! hashtable key proc default
1961 Associates with @var{key} in the hash table @var{hashtable} the result
1962 of calling @var{proc}, which must be a procedure that takes one
1963 argument, on the value currently associated @var{key} in
1964 @var{hashtable} --- or on @var{default} if no such association exists.
1965 An @code{&assertion} condition is raised if @var{hashtable} is
1966 immutable.
1967 @end deffn
1968
1969 @deffn {Scheme Procedure} hashtable-copy hashtable
1970 @deffnx {Scheme Procedure} hashtable-copy hashtable mutable
1971 Returns a copy of the hash table @var{hashtable}. If the optional
1972 argument @var{mutable} is a true value, the new hash table will be
1973 immutable.
1974 @end deffn
1975
1976 @deffn {Scheme Procedure} hashtable-clear! hashtable
1977 @deffnx {Scheme Procedure} hashtable-clear! hashtable k
1978 Removes all of the associations from the hash table @var{hashtable}.
1979 The optional argument @var{k}, which specifies a new capacity for the
1980 hash table, is accepted by Guile's @code{(rnrs hashtables)}
1981 implementation, but is ignored.
1982 @end deffn
1983
1984 @deffn {Scheme Procedure} hashtable-keys hashtable
1985 Returns a vector of the keys with associations in the hash table
1986 @var{hashtable}, in an unspecified order.
1987 @end deffn
1988
1989 @deffn {Scheme Procedure} hashtable-entries hashtable
1990 Return two values --- a vector of the keys with associations in the
1991 hash table @var{hashtable}, and a vector of the values to which these
1992 keys are mapped, in corresponding but unspecified order.
1993 @end deffn
1994
1995 @deffn {Scheme Procedure} hashtable-equivalence-function hashtable
1996 Returns the equivalence predicated use by @var{hashtable}. This
1997 procedure returns @code{eq?} and @code{eqv?}, respectively, for hash
1998 tables created by @code{make-eq-hashtable} and
1999 @code{make-eqv-hashtable}.
2000 @end deffn
2001
2002 @deffn {Scheme Procedure} hashtable-hash-function hashtable
2003 Returns the hash function used by @var{hashtable}. For hash tables
2004 created by @code{make-eq-hashtable} or @code{make-eqv-hashtable},
2005 @code{#f} is returned.
2006 @end deffn
2007
2008 @deffn {Scheme Procedure} hashtable-mutable? hashtable
2009 Returns @code{#t} if @var{hashtable} is mutable, @code{#f} otherwise.
2010 @end deffn
2011
2012 A number of hash functions are provided for convenience:
2013
2014 @deffn {Scheme Procedure} equal-hash obj
2015 Returns an integer hash value for @var{obj}, based on its structure and
2016 current contents. This hash function is suitable for use with
2017 @code{equal?} as an equivalence function.
2018 @end deffn
2019
2020 @deffn {Scheme Procedure} string-hash string
2021 @deffnx {Scheme Procedure} symbol-hash symbol
2022 These procedures are identical to the ones provided by Guile's core
2023 library. @xref{Hash Table Reference}, for documentation.
2024 @end deffn
2025
2026 @deffn {Scheme Procedure} string-ci-hash string
2027 Returns an integer hash value for @var{string} based on its contents,
2028 ignoring case. This hash function is suitable for use with
2029 @code{string-ci=?} as an equivalence function.
2030 @end deffn
2031
2032 @node rnrs enums
2033 @subsubsection rnrs enums
2034
2035 The @code{(rnrs enums (6))} library provides structures and procedures
2036 for working with enumerable sets of symbols. Guile's implementation
2037 defines an @dfn{enum-set} record type that encapsulates a finite set of
2038 distinct symbols, the @dfn{universe}, and a subset of these symbols,
2039 which define the enumeration set.
2040
2041 The SRFI-1 list library provides a number of procedures for performing
2042 set operations on lists; Guile's @code{(rnrs enums)} implementation
2043 makes use of several of them. @xref{SRFI-1 Set Operations}, for
2044 more information.
2045
2046 @deffn {Scheme Procedure} make-enumeration symbol-list
2047 Returns a new enum-set whose universe and enumeration set are both equal
2048 to @var{symbol-list}, a list of symbols.
2049 @end deffn
2050
2051 @deffn {Scheme Procedure} enum-set-universe enum-set
2052 Returns an enum-set representing the universe of @var{enum-set},
2053 an enum-set.
2054 @end deffn
2055
2056 @deffn {Scheme Procedure} enum-set-indexer enum-set
2057 Returns a procedure that takes a single argument and returns the
2058 zero-indexed position of that argument in the universe of
2059 @var{enum-set}, or @code{#f} if its argument is not a member of that
2060 universe.
2061 @end deffn
2062
2063 @deffn {Scheme Procedure} enum-set-constructor enum-set
2064 Returns a procedure that takes a single argument, a list of symbols
2065 from the universe of @var{enum-set}, an enum-set, and returns a new
2066 enum-set with the same universe that represents a subset containing the
2067 specified symbols.
2068 @end deffn
2069
2070 @deffn {Scheme Procedure} enum-set->list enum-set
2071 Returns a list containing the symbols of the set represented by
2072 @var{enum-set}, an enum-set, in the order that they appear in the
2073 universe of @var{enum-set}.
2074 @end deffn
2075
2076 @deffn {Scheme Procedure} enum-set-member? symbol enum-set
2077 @deffnx {Scheme Procedure} enum-set-subset? enum-set1 enum-set2
2078 @deffnx {Scheme Procedure} enum-set=? enum-set1 enum-set2
2079 These procedures test for membership of symbols and enum-sets in other
2080 enum-sets. @code{enum-set-member?} returns @code{#t} if and only if
2081 @var{symbol} is a member of the subset specified by @var{enum-set}.
2082 @code{enum-set-subset?} returns @code{#t} if and only if the universe of
2083 @var{enum-set1} is a subset of the universe of @var{enum-set2} and
2084 every symbol in @var{enum-set1} is present in @var{enum-set2}.
2085 @code{enum-set=?} returns @code{#t} if and only if @var{enum-set1} is a
2086 subset, as per @code{enum-set-subset?} of @var{enum-set2} and vice
2087 versa.
2088 @end deffn
2089
2090 @deffn {Scheme Procedure} enum-set-union enum-set1 enum-set2
2091 @deffnx {Scheme Procedure} enum-set-intersection enum-set1 enum-set2
2092 @deffnx {Scheme Procedure} enum-set-difference enum-set1 enum-set2
2093 These procedures return, respectively, the union, intersection, and
2094 difference of their enum-set arguments.
2095 @end deffn
2096
2097 @deffn {Scheme Procedure} enum-set-complement enum-set
2098 Returns @var{enum-set}'s complement (an enum-set), with regard to its
2099 universe.
2100 @end deffn
2101
2102 @deffn {Scheme Procedure} enum-set-projection enum-set1 enum-set2
2103 Returns the projection of the enum-set @var{enum-set1} onto the universe
2104 of the enum-set @var{enum-set2}.
2105 @end deffn
2106
2107 @deffn {Scheme Syntax} define-enumeration type-name (symbol ...) constructor-syntax
2108 Evaluates to two new definitions: A constructor bound to
2109 @var{constructor-syntax} that behaves similarly to constructors created
2110 by @code{enum-set-constructor}, above, and creates new @var{enum-set}s
2111 in the universe specified by @code{(symbol ...)}; and a ``predicate
2112 macro'' bound to @var{type-name}, which has the following form:
2113
2114 @lisp
2115 (@var{type-name} sym)
2116 @end lisp
2117
2118 If @var{sym} is a member of the universe specified by the @var{symbol}s
2119 above, this form evaluates to @var{sym}. Otherwise, a @code{&syntax}
2120 condition is raised.
2121 @end deffn
2122
2123 @node rnrs
2124 @subsubsection rnrs
2125
2126 The @code{(rnrs (6))} library is a composite of all of the other R6RS
2127 standard libraries --- it imports and re-exports all of their exported
2128 procedures and syntactic forms --- with the exception of the following
2129 libraries:
2130
2131 @itemize @bullet
2132 @item @code{(rnrs eval (6))}
2133 @item @code{(rnrs mutable-pairs (6))}
2134 @item @code{(rnrs mutable-strings (6))}
2135 @item @code{(rnrs r5rs (6))}
2136 @end itemize
2137
2138 @node rnrs eval
2139 @subsubsection rnrs eval
2140
2141 The @code{(rnrs eval (6)} library provides procedures for performing
2142 ``on-the-fly'' evaluation of expressions.
2143
2144 @deffn {Scheme Procedure} eval expression environment
2145 Evaluates @var{expression}, which must be a datum representation of a
2146 valid Scheme expression, in the environment specified by
2147 @var{environment}. This procedure is identical to the one provided by
2148 Guile's code library; (@pxref{Fly Evaluation}) for documentation.
2149 @end deffn
2150
2151 @deffn {Scheme Procedure} environment import-spec ...
2152 Constructs and returns a new environment based on the specified
2153 @var{import-spec}s, which must be datum representations of the import
2154 specifications used with the @code{import} form. @xref{R6RS Libraries},
2155 for documentation.
2156 @end deffn
2157
2158 @node rnrs mutable-pairs
2159 @subsubsection rnrs mutable-pairs
2160
2161 The @code{(rnrs mutable-pairs (6))} library provides the @code{set-car!}
2162 and @code{set-cdr!} procedures, which allow the @code{car} and
2163 @code{cdr} fields of a pair to be modified.
2164
2165 These procedures are identical to the ones provide by Guile's core
2166 library. @xref{Pairs}, for documentation. All pairs in Guile are
2167 mutable; consequently, these procedures will never throw the
2168 @code{&assertion} condition described in the R6RS libraries
2169 specification.
2170
2171 @node rnrs mutable-strings
2172 @subsubsection rnrs mutable-strings
2173
2174 The @code{(rnrs mutable-strings (6))} library provides the
2175 @code{string-set!} and @code{string-fill!} procedures, which allow the
2176 content of strings to be modified ``in-place.''
2177
2178 These procedures are identical to the ones provided by Guile's core
2179 library. @xref{String Modification}, for documentation. All strings in
2180 Guile are mutable; consequently, these procedures will never throw the
2181 @code{&assertion} condition described in the R6RS libraries
2182 specification.
2183
2184 @node rnrs r5rs
2185 @subsubsection rnrs r5rs
2186
2187 The @code{(rnrs r5rs (6))} library exports bindings for some procedures
2188 present in R5RS but omitted from the R6RS base library specification.
2189
2190 @deffn {Scheme Procedure} exact->inexact z
2191 @deffnx {Scheme Procedure} inexact->exact z
2192 These procedures are identical to the ones provided by Guile's core
2193 library. @xref{Exactness}, for documentation.
2194 @end deffn
2195
2196 @deffn {Scheme Procedure} quotient n1 n2
2197 @deffnx {Scheme Procedure} remainder n1 n2
2198 @deffnx {Scheme Procedure} modulo n1 n2
2199 These procedures are identical to the ones provided by Guile's core
2200 library. @xref{Integer Operations}, for documentation.
2201 @end deffn
2202
2203 @deffn {Scheme Syntax} delay expr
2204 @deffnx {Scheme Procedure} force promise
2205 The @code{delay} form and the @code{force} procedure are identical to
2206 their counterparts in Guile's core library. @xref{Delayed Evaluation},
2207 for documentation.
2208 @end deffn
2209
2210 @deffn {Scheme Procedure} null-environment n
2211 @deffnx {Scheme Procedure} scheme-report-environment n
2212 These procedures are identical to the ones provided by the
2213 @code{(ice-9 r5rs)} Guile module. @xref{Environments}, for
2214 documentation.
2215 @end deffn
2216
2217 @c r6rs.texi ends here
2218
2219 @c Local Variables:
2220 @c TeX-master: "guile.texi"
2221 @c End: