Warning: This is the manual of the legacy Guile 2.2 series. You may want to read the manual of the current stable series instead.
Next: rnrs unicode, Previous: Library Usage, Up: R6RS Standard Libraries [Contents][Index]
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 Booleans, for documentation.
See Symbol Primitives, for documentation.
See Characters, for documentation.
See List Predicates, for documentation.
See Pairs, for documentation.
See Numerical Tower, for documentation.
See String Predicates, for documentation.
See Procedure Properties, for documentation.
See Definition, for documentation.
See Defining Macros, for documentation.
See Identifier Macros, for documentation.
See Syntax Rules, for documentation.
See Lambda, for documentation.
See Local Bindings, for documentation.
See SRFI-11, for documentation.
See begin, for documentation.
See Expression Syntax, for documentation.
See Conditionals, for documentation.
See and or, for documentation.
See Equality, for documentation.
symbol=?
is identical to eq?
.
See Complex Numbers, for documentation.
See Complex, for documentation.
See Scientific, for documentation.
See Reals and Rationals, for documentation.
See Exactness, for documentation. The exact
and
inexact
procedures are identical to the inexact->exact
and
exact->inexact
procedures provided by Guile’s code library.
See Integers, for documentation.
See Integer Operations, for documentation.
See Comparison, for documentation.
See SRFI-1 Fold and Map, for documentation.
See List Constructors, for documentation.
See List Selection, for documentation.
See Append/Reverse, for documentation.
See Conversion, 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, 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 Vector Creation, for documentation.
See Vector Accessors, for documentation.
See Continuations, for documentation.
See Multiple Values, for documentation.
See Dynamic Wind, for documentation.
See Fly Evaluation, for documentation.
Next: rnrs unicode, Previous: Library Usage, Up: R6RS Standard Libraries [Contents][Index]