The (rnrs base (6))
library exports the procedures and syntactic
forms described in the main section of the Report
(see R6RS Base library in The Revised^6 Report on the Algorithmic Language Scheme). They are
grouped below by the existing manual sections to which they correspond.
See Operations Related to Symbols, for documentation.
See Characters, for documentation.
See List Predicates, for documentation.
See Pairs, for documentation.
See Scheme’s Numerical “Tower”, for documentation.
See String Predicates, for documentation.
See Procedure Properties and Meta-information, for documentation.
See Defining and Setting Variables, for documentation.
See Defining Macros, for documentation.
See Identifier Macros, for documentation.
See Syntax-rules Macros, for documentation.
See Lambda: Basic Procedure Creation, for documentation.
See Local Variable Bindings, for documentation.
See SRFI-11 - let-values, for documentation.
See Sequencing and Splicing, for documentation.
See Expression Syntax, for documentation.
See Simple Conditional Evaluation, for documentation.
See Conditional Evaluation of a Sequence of Expressions, for documentation.
See Equality, for documentation.
symbol=?
is identical to eq?
.
See Complex Numbers, for documentation.
See Complex Number Operations, for documentation.
See Scientific Functions, for documentation.
See Real and Rational Numbers, for documentation.
See Exact and Inexact Numbers, for documentation. The exact
and
inexact
procedures are identical to the inexact->exact
and
exact->inexact
procedures provided by Guile’s code library.
See Operations on Integer Values, for documentation.
See Comparison Predicates, for documentation.
See Fold, Unfold & Map, for documentation.
See List Constructors, for documentation.
See List Selection, for documentation.
See Append and Reverse, for documentation.
See Converting Numbers To and From Strings, for documentation.
See String Constructors, for documentation.
See List/String conversion, for documentation.
See String Selection, for documentation.
See String Comparison, for documentation.
See Reversing and Appending Strings, for documentation.
See Mapping, Folding, and Unfolding, for documentation.
See Arithmetic Functions, for documentation.
These procedures accept two real numbers x and y, where the
divisor y must be non-zero. div
returns the integer q
and mod
returns the real number r such that
x = q*y + r and 0 <= r < abs(y).
div-and-mod
returns both q and r, and is more
efficient than computing each separately. Note that when y > 0,
div
returns floor(x/y), otherwise
it returns ceiling(x/y).
(div 123 10) ⇒ 12 (mod 123 10) ⇒ 3 (div-and-mod 123 10) ⇒ 12 and 3 (div-and-mod 123 -10) ⇒ -12 and 3 (div-and-mod -123 10) ⇒ -13 and 7 (div-and-mod -123 -10) ⇒ 13 and 7 (div-and-mod -123.2 -63.5) ⇒ 2.0 and 3.8 (div-and-mod 16/3 -10/7) ⇒ -3 and 22/21
These procedures accept two real numbers x and y, where the
divisor y must be non-zero. div0
returns the
integer q and mod0
returns the real number
r such that x = q*y + r and
-abs(y/2) <= r < abs(y/2). div0-and-mod0
returns both q and r, and is more efficient than computing
each separately.
Note that div0
returns x/y rounded to the
nearest integer. When x/y lies exactly half-way
between two integers, the tie is broken according to the sign of
y. If y > 0, ties are rounded toward positive
infinity, otherwise they are rounded toward negative infinity.
This is a consequence of the requirement that
-abs(y/2) <= r < abs(y/2).
(div0 123 10) ⇒ 12 (mod0 123 10) ⇒ 3 (div0-and-mod0 123 10) ⇒ 12 and 3 (div0-and-mod0 123 -10) ⇒ -12 and 3 (div0-and-mod0 -123 10) ⇒ -12 and -3 (div0-and-mod0 -123 -10) ⇒ 12 and -3 (div0-and-mod0 -123.2 -63.5) ⇒ 2.0 and 3.8 (div0-and-mod0 16/3 -10/7) ⇒ -4 and -8/21
These procedures return #t
if and only if their arguments can,
respectively, be coerced to a real, rational, or integer value without a
loss of numerical precision.
real-valued?
will return #t
for complex numbers whose
imaginary parts are zero.
nan?
returns #t
if x is a NaN value, #f
otherwise. infinite?
returns #t
if x is an infinite
value, #f
otherwise. finite?
returns #t
if x
is neither infinite nor a NaN value, otherwise it returns #f
.
Every real number satisfies exactly one of these predicates. An
exception is raised if x is not real.
Raises an &assertion
condition if expr evaluates to
#f
; otherwise evaluates to the value of expr.
These procedures raise compound conditions based on their arguments:
If who is not #f
, the condition will include a &who
condition whose who
field is set to who; a &message
condition will be included with a message
field equal to
message; an &irritants
condition will be included with its
irritants
list given by irritant1 ...
.
error
produces a compound condition with the simple conditions
described above, as well as an &error
condition;
assertion-violation
produces one that includes an
&assertion
condition.
These procedures implement the map
and for-each
contracts
over vectors.
See Dynamic Vector Creation and Validation, for documentation.
See Accessing and Modifying Vector Contents, for documentation.
See Continuations, for documentation.
See Returning and Accepting Multiple Values, for documentation.
See Dynamic Wind, for documentation.
See Procedures for On the Fly Evaluation, for documentation.