read-char
, read
, write-char
,
write
, display
, and newline
.
The procedures below were specified in the Revised^2 Report on
Scheme. N.B.: The symbols 1+
and -1+
are not
R4RS syntax. Scheme->C, for instance, barfs on this
module.
0 <= start1 <= end1 <= (string-length string1) 0 <= start2 <= end1 - start1 + start2 <= (string-length string2)
substring-move-left!
and substring-move-right!
store
characters of string1 beginning with index start1
(inclusive) and ending with index end1 (exclusive) into
string2 beginning with index start2 (inclusive).
substring-move-left!
stores characters in time order of
increasing indices. substring-move-right!
stores characters in
time order of increasing indeces.
(= 0 (string-length str))
nconc
.
(require 'rev4-optional-procedures)
For the specification of these optional procedures, See section `Standard procedures' in Revised(4) Scheme.
For the specification of these optional forms, See section `Numerical operations' in Revised(4) Scheme. The two-arg:
* forms are
only defined if the implementation does not support the many-argument
forms.
/
.
-
.
For the specification of this optional form, See section `Control features' in Revised(4) Scheme.
apply
. Only defined for
implementations which don't support the many-argument version.
The procedure rationalize is interesting because most programming languages do not provide anything analogous to it. For simplicity, we present an algorithm which computes the correct result for exact arguments (provided the implementation supports exact rational numbers of unlimited precision), and produces a reasonable answer for inexact arguments when inexact arithmetic is implemented using floating-point. We thank Alan Bawden for contributing this algorithm.
Change occurrences of (delay expression)
to
(make-promise (lambda () expression))
and (define
force promise:force)
to implement promises if your implementation
doesn't support them
(see section `Control features' in Revised(4) Scheme).
This facility is a generalization of Common LISP unwind-protect
,
designed to take into account the fact that continuations produced by
call-with-current-continuation
may be reentered.
dynamic-wind
calls thunk1, thunk2, and then
thunk3. The value returned by thunk2 is returned as the
result of dynamic-wind
. thunk3 is also called just before
control leaves the dynamic context of thunk2 by calling a
continuation created outside that context. Furthermore, thunk1 is
called before reentering the dynamic context of thunk2 by calling
a continuation created inside that context. (Control is inside the
context of thunk2 if thunk2 is on the current return stack).
Warning: There is no provision for dealing with errors or
interrupts. If an error or interrupt occurs while using
dynamic-wind
, the dynamic environment will be that in effect at
the time of the error or interrupt.
values
takes any number of arguments, and passes (returns) them
to its continuation.
call-with-values
calls thunk with a
continuation that, when passed some values, calls proc with those
values as arguments.
Except for continuations created by the call-with-values
procedure, all continuations take exactly one value, as now; the effect
of passing no value or more than one value to continuations that were
not created by the call-with-values
procedure is
unspecified.
The procedures current-time
, difftime
, and
offset-time
are supported by all implementations (SLIB provides
them if feature ('current-time)
is missing. current-time
returns a calendar time (caltime) which can be a number or other
type.
get-universal-time
in section CLTime. On implementations
which cannot support actual times, current-time
will increment a
counter and return its value when called.
(+ caltime offset)
.
(require 'posix-time)
These procedures are intended to be compatible with Posix time conversion functions.
*timezone*
is initialized by tzset
.
localtime
sets the variable
*timezone* with the difference between Coordinated Universal Time
(UTC) and local standard time in seconds by calling tzset
.
The elements of the returned vector are as follows:
decode-universal-time
.
decode-universal-time
.
"Wed Jun 30 21:49:08 1993"
.
(time:asctime (time:localtime caltime))
.
(decode-universal-time (get-universal-time))
.
current-time
.
gmtime
and localtime
.
gmtime
and localtime
.
Notice that the values returned by decode-universal-time
do not
match the arguments to encode-universal-time
.
Notice that the values returned by decode-universal-time
do not
match the arguments to encode-universal-time
.
Go to the first, previous, next, last section, table of contents.