|
* |
Form | (* z1 ...) |
Description | Return the product of the arguments |
Parameters | z1 | A complex number |
See also | R5RS | R5RS |
Note | procedure |
|
+ |
Form | (+ z1 ...) |
Description | Return the sum of the arguments |
Parameters | z1 | A complex number |
See also | more details | R5RS |
Note | procedure |
|
- |
Form | ( - z1 ...) |
Description | With two or more arguments, this procedure returns the difference
of its arguments, associating to the left. With one argument, however,
it returns the additive inverse of its argument. |
Parameters | z1 | A complex number |
See also | more details | R5RS |
Note | procedure |
|
/ |
Form | (/ z1 ...) |
Description | With two or more arguments, this procedure returns the quotient
of its arguments, associating to the left. With one argument, however,
it returns the multiplicative inverse of its argument. |
Parameters | z1 | A complex number |
See also | more details | R5RS |
Note | procedure |
|
< |
Form | (< x1 x2 x3 ...) |
Description | This procedure returns #t if their arguments are monotonically increasing |
Parameters | x1 | A real number |
x2 | A real number |
x3 | A real number |
See also | more details | R5RS |
Note | procedure |
|
<= |
Form | (<= x1 x2 x3 ...) |
Description | This procedure returns #t if their arguments are monotonically nondecreasing |
Parameters | x1 | A real number |
x2 | A real number |
x3 | A real number |
See also | more details | R5RS |
Note | procedure |
|
= |
Form | (= z1 z2 z3) |
Description | This procedure returns #t if their arguments are all equal |
Parameters | z1 | A complex number |
z2 | A complex number |
z3 | A complex number |
See also | more details | R5RS |
Note | procedure |
|
> |
Form | (> x1 x2 x3 ...) |
Description | This procedure returns #t if their arguments are monotonically decreasing |
Parameters | x1 | A real number |
x2 | A real number |
x3 | A real number |
See also | more details | R5RS |
Note | procedure |
|
>= |
Form | (>= x1 x2 x3 ...) |
Description | This procedure returns #t if their arguments are monotonically nonincreasing. |
Parameters | x1 | A real number |
x2 | A real number |
x3 | A real number |
See also | more details | R5RS |
Note | procedure |
|
abs |
Form | (abs x) |
Description | Abs returns the absolute value of its argument. |
Parameters | x | A real number |
See also | more details | R5RS |
Note | procedure |
|
acos |
Form | (acos z) |
Description | Computes the arccosine of its argument |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
and |
Form | (and test ...) |
Description | The test expressions are evaluated from left to right, and the value
of the first expression that evaluates to a false value is returned. Any remaining expressions
are not evaluated. If all the expressions evaluate to true values,
the value of the last expression is returned. If there are no expressions
then #t is returned. |
See also | more details | R5RS |
Note | syntax |
|
angle |
Form | (angle z) |
Description | The angle of a complex number. Relates to the polar representation of z.
This procedure is part of every implementation that supports general complex numbers |
Parameters | z | A complex number |
Parameters | z | A complex number |
Returns | |
See also | more details | R5RS |
Note | procedure |
|
append |
Form | (append list ...) |
Description | Returns a list consisting of the elements of the first list followed by the elements
of the other lists. The resulting list is always newly allocated, except that it shares
structure with the last list argument. The last argument may actually be any object;
an improper list results if the last argument is not a proper list. |
See also | more details | R5RS |
Note | procedure |
|
apply |
Form | (apply proc arg1 ... args) |
Description | Calls proc with the elements of the list (append (list arg1 ...) args) as the actual arguments. |
Parameters | proc | a procedure |
arg1 | Arbibitrary data object |
args | A list |
Returns | |
See also | more details | R5RS |
Note | procedure |
|
asin |
Form | (asin z) |
Description | Computes the arcsin of its argument |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
assoc |
Form | (assoc obj alist) |
Description | This procedure finds the first pair in alist whose car field is obj, and returns that pair.
If no pair in alist has obj as its car, then #f (not the empty list) is returned. Uses equal? for comparison. |
Parameters | obj | Some data object |
alist | A list of pairs, an association list. |
Returns | The pair whose car is equal to obj. |
See also | more details | R5RS |
Note | procedure |
|
assq |
Form | (assq obj alist) |
Description | This procedure finds the first pair in alist whose car field is obj, and returns that pair.
If no pair in alist has obj as its car, then #f (not the empty list) is returned. Uses eq? for comparison. |
Parameters | obj | Some data object |
alist | A list of pairs, an association list. |
Returns | The pair whose car is equal to obj (comparison done with eq?) |
See also | more details | R5RS |
Note | procedure |
|
assv |
Form | (assv obj alist) |
Description | This procedure finds the first pair in alist whose car field is obj, and returns that pair.
If no pair in alist has obj as its car, then #f (not the empty list) is returned. Uses eqv? for comparison. |
Parameters | obj | Some data object |
alist | A list of pairs, an association list. |
Returns | The pair whose car is equal to obj (comparison done with eq?) |
See also | more details | R5RS |
Note | procedure |
|
atan |
Form | (atan z) |
Description | Returns arctangent of its argument.
A two-argument variant of atan computes (angle (make-rectangular x y))
even in implementations that don't support general complex numbers.) |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure. |
|
begin |
Form | (begin expression1 expression2 ...) |
Description | The expressions are evaluated sequentially from left to right, and the value(s) of the
last expression is(are) returned. This expression type is used to sequence side effects
such as input and output. |
See also | more details | R5RS |
Note | syntax |
|
boolean? |
Form | (boolean? obj) |
Description | The precidate that recognizes boolean values. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
Parameters | obj | Any kind of Scheme object |
Returns | returns #t if obj is either #t or #f and returns #f otherwise. |
See also | more details | R5RS |
Note | procedure |
|
caaaar |
Form | (caaaar pair) |
Description | Equivalent to (car (car (car (car pair)))) |
See also | more details | R5RS |
Note | procedure |
|
caaadr |
Form | (caaadr pair) |
Description | Equivalent to (car (car (cdr (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
caaar |
Form | (caaar pair) |
Description | Equivalent to (car (car (car pair))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
caadar |
Form | (caadar pair) |
Description | Equivalent to (car (car (cdr (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
caaddr |
Form | (caaddr pair) |
Description | Equivalent to (car (car (cdr (cdr pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
caadr |
Form | (caadr pair) |
Description | Equivalent to (car (car (cdr pair))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
caar |
Form | (caar pair) |
Description | Equivalent to (car (car pair)) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cadaar |
Form | (cadaar pair) |
Description | Equivalent to (car (cdr (car (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cadadr |
Form | (cadadr pair) |
Description | Equivalent to (car (cdr (car (cdr pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cadar |
Form | (cadar pair) |
Description | Equivalent to (car (cdr (car pair))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
caddar |
Form | (caddar pair) |
Description | Equivalent to (car (cdr (cdr (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cadddr |
Form | (cadddr pair) |
Description | Equivalent to (car (cdr (cdr (cdr pair)))). The fourth element in a list. |
Parameters | pair | A dotted pair |
Returns | |
See also | more details | R5RS |
Note | procedure |
|
caddr |
Form | (caddr pair) |
Description | Equivalent to (car (cdr (cdr pair))). The third element in a list. |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cadr |
Form | (cadr pair) |
Description | Equivalent to (car (cdr pair)) ). The second element in a list. |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
call-with-current-continuation |
Form | (call-with-current-continuation proc) |
Description | Proc must be a procedure of one argument. The procedure call-with-current-continuation packages up the current continuation (see the rationale below) as an escape procedure and passes it as an argument to proc. The escape procedure is a Scheme procedure that, if it is later called, will abandon whatever continuation is in effect at that later time and will instead use the continuation that was in effect when the escape procedure was created. Calling the escape procedure may cause the invocation of before and after thunks installed using dynamic-wind. - The escape procedure accepts the same number of arguments as the continuation to the original call to call-with-current-continuation. Except for continuations created by the call-with-values procedure, all continuations take exactly one value. The effect of passing no value or more than one value to continuations that were not created by call-with-values is unspecified. - The escape procedure that is passed to proc has unlimited extent just like any other procedure in Scheme. It may be stored in variables or data structures and may be called as many times as desired. |
Parameters | proce | A procedure of one argument |
See also | more details | R5RS |
Note | procedure |
|
call/cc |
Form | (call/cc proc) |
Description | Proc must be a procedure of one argument. The procedure call-with-current-continuation packages up the current continuation (see the rationale below) as an escape procedure and passes it as an argument to proc. The escape procedure is a Scheme procedure that, if it is later called, will abandon whatever continuation is in effect at that later time and will instead use the continuation that was in effect when the escape procedure was created. Calling the escape procedure may cause the invocation of before and after thunks installed using dynamic-wind. - The escape procedure accepts the same number of arguments as the continuation to the original call to call-with-current-continuation. Except for continuations created by the call-with-values procedure, all continuations take exactly one value. The effect of passing no value or more than one value to continuations that were not created by call-with-values is unspecified. - The escape procedure that is passed to proc has unlimited extent just like any other procedure in Scheme. It may be stored in variables or data structures and may be called as many times as desired. |
Parameters | proce | A procedure of one argument |
See also | more details | R5RS |
Note | procedure |
|
call-with-input-file |
Form | (call-with-input-file string proc) |
Description | This procedure calls proc with one argument: the port obtained by opening the named file for input or output. If the file cannot be opened, an error is signalled. If proc returns, then the port is closed automatically and the value(s) yielded by the proc is(are) returned. If proc does not return, then the port will not be closed automatically unless it is possible to prove that the port will never again be used for a read or write operation. |
Precondition | The file should already exist |
Parameters | string | names a file |
proc | a procedure that accepts one argument (a port) |
See also | more details | R5RS |
Note | procedure |
|
call-with-output-file |
Form | (call-with-output-file string proc) |
Description | This procedure calls proc with one argument: the port obtained by opening the named file for input or output. If the file cannot be opened, an error is signalled. If proc returns, then the port is closed automatically and the value(s) yielded by the proc is(are) returned. If proc does not return, then the port will not be closed automatically unless it is possible to prove that the port will never again be used for a read or write operation. |
Precondition | the effect of this procedue is unspecified if the file already exists. |
Parameters | string | names a file |
proc | a procedure that accepts one argument (a port) |
Returns | |
See also | more details | R5RS |
Note | procedure |
|
call-with-values |
Form | (call-with-values producer consumer) |
Description | Calls its producer argument with no values and a continuation that, when passed some values, calls the consumer procedure with those values as arguments. The continuation for the call to consumer is the continuation of the call to call-with-values. |
Parameters | producer | a procure with no parameters |
consumer | a procure some parameters |
See also | more details | R5RS |
Note | procedure |
|
car |
Form | (car pair) |
Description | Returns the contents of the car field of pair. Note that it is an error to take the car of the empty list. |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
case |
Form | (case key ((datum1 ...) expression1 expression2 ...) ...) |
Description | Key is evaluated and its result is compared against each datum. If the result of evaluating key is equivalent (in the sense of eqv? to a datum, then the expressions in the corresponding clause are evaluated from left to right and the result(s) of the last expression in the clause is(are) returned as the result(s) of the case expression. If the result of evaluating key is different from every datum, then if there is an else clause its expressions are evaluated and the result(s) of the last is(are) the result(s) of the case expression; otherwise the result of the case expression is unspecified. |
See also | more details | R5RS |
Note | syntax |
|
cdaaar |
Form | (cdaaar pair) |
Description | Equivalent to (cdr (car (car (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdaadr |
Form | (cdaadr pair) |
Description | Equivalent to (cdr (car (car (cdr pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdaar |
Form | (cdaar pair) |
Description | Equivalent to (cdr (car (car pair))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdadar |
Form | (cdadar pair) |
Description | Equivalent to (cdr (car (cdr (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdaddr |
Form | (cdaddr pair) |
Description | Equivalent to (cdr (car (cdr (cdr pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdadr |
Form | (cdadr pair) |
Description | Equivalent to (cdr (car (cdr pair))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdar |
Form | (cdar pair) |
Description | Equivalent to (cdr (car pair)) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cddaar |
Form | (cddaar pair) |
Description | Equivalent to (cdr (cdr (car (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cddadr |
Form | (cddadr pair) |
Description | Equivalent to (cdr (cdr (car (cdr pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cddar |
Form | (cddar pair) |
Description | Equivalent to (cdr (cdr (car pair))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdddar |
Form | (cdddar pair) |
Description | Equivalent to (cdr (cdr (cdr (car pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cddddr |
Form | (cddddr pair) |
Description | Equivalent to (cdr (cdr (cdr (cdr pair)))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdddr |
Form | (cdddr pair) |
Description | Equivalent to (cdr (cdr (cdr pair))) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cddr |
Form | (cddr pair) |
Description | Equivalent to (cdr (cdr pair)) |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
cdr |
Form | (cdr pair) |
Description | Returns the contents of the cdr field of pair. Note that it is an error to take the cdr of the empty list. |
Parameters | pair | A dotted pair |
See also | more details | R5RS |
Note | procedure |
|
ceiling |
Form | (ceiling x) |
Description | Ceiling returns the smallest integer not smaller than x. |
Parameters | x | A real number |
See also | more details | R5RS |
Note | procedure |
|
char->integer |
Form | (char->integer char) |
Description | Given a character, this procedure returns an exact integer representation of the character.
Implement together with integer->char order-preserving isomorphisms between the set of characters under the char<=? ordering and some subset of the integers under the <= ordering. |
Returns | |
See also | more details | R5RS |
Note | procedure |
|
char-alphabetic? |
Form | (char-alphabetic? char) |
Description | This procedure returns #t if its argument is alphabetic; otherwise it returns #f. The following remarks, which are specific to the ASCII character set, are intended only as a guide: The alphabetic characters are the 52 upper and lower case letters. The numeric characters are the ten decimal digits. The whitespace characters are space, tab, line feed, form feed, and carriage return. |
See also | more details | R5RS |
Note | procedure |
|
char-ci<=? |
Form | (char-ci<=? char1 char2) |
Description | This procedure is similar to char<=?, but it treat upper case and lower case letters as the same. Some implementations may generalize these procedures to take more than two arguments, as with the corresponding numerical predicates. |
See also | more details | R5RS |
Note | procedure |
|
char-ci<? |
Form | (char-ci<? char1 char2) |
Description | This procedure is similar to char<?, but it treat upper case and lower case letters as the same. Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates. |
See also | more details | R5RS |
Note | procedure |
|
char-ci=? |
Form | (char-ci=? char1 char2) |
Description | This procedure is similar to char=?, but it treat upper case and lower case letters as the same. Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates. |
See also | more details | R5RS |
Note | procedure |
|
char-ci>=? |
Form | (char-ci>=? char1 char2) |
Description | This procedure is similar to char>=?, but it treat upper case and lower case letters as the same. Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates. |
See also | more details | R5RS |
Note | procedure |
|
char-ci>? |
Form | (char-ci>? char1 char2) |
Description | This procedure is similar to char>?, but it treat upper case and lower case letters as the same. Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates. |
See also | more details | R5RS |
Note | procedure |
|
char-downcase |
Form | (char-downcase char) |
Description | This procedure return a character char2 such that (char-ci=? char char2). In addition, if char is alphabetic, then the result of char-downcase is lower case. |
See also | more details | R5RS |
Note | procedure |
|
char-lower-case? |
Form | (char-lower-case? char) |
Description | This procedure returns #t if its argument is a lower case character, otherwise it returns #f. The following remarks, which are specific to the ASCII character set, are intended only as a guide: The alphabetic characters are the 52 upper and lower case letters. The numeric characters are the ten decimal digits. The whitespace characters are space, tab, line feed, form feed, and carriage return. |
See also | more details | R5RS |
Note | procedure |
|
char-numeric? |
Form | (char-numeric? char) |
Description | This procedure returns #t if its argument is a numeric character, otherwise it returns #f. The following remarks, which are specific to the ASCII character set, are intended only as a guide: The alphabetic characters are the 52 upper and lower case letters. The numeric characters are the ten decimal digits. The whitespace characters are space, tab, line feed, form feed, and carriage return. |
See also | more details | R5RS |
Note | procedure |
|
char-ready? |
Form | (char-ready? port) |
Description | Returns #t if a character is ready on the input port and returns #f otherwise. If char-ready returns #t then the next read-char operation on the given port is guaranteed not to hang. If the port is at end of file then char-ready? returns #t. Port may be omitted, in which case it defaults to the value returned by current-input-port. |
See also | more details | R5RS |
Note | procedure |
|
char-upcase |
Form | (char-upcase char) |
Description | This procedure return a character char2 such that (char-ci=? char char2). In addition, if char is alphabetic, then the result of char-upcase is upper case. |
See also | more details | R5RS |
Note | procedure |
|
char-upper-case? |
Form | (char-upper-case? char) |
Description | This procedure returns #t if its argument is a upper case character, otherwise it returns #f. The following remarks, which are specific to the ASCII character set, are intended only as a guide: The alphabetic characters are the 52 upper and lower case letters. The numeric characters are the ten decimal digits. The whitespace characters are space, tab, line feed, form feed, and carriage return. |
See also | more details | R5RS |
Note | procedure |
|
char-whitespace? |
Form | (char-whitespace? char) |
Description | This procedure returns #t if its argument is a white space character, otherwise it returns #f. The following remarks, which are specific to the ASCII character set, are intended only as a guide: The alphabetic characters are the 52 upper and lower case letters. The numeric characters are the ten decimal digits. The whitespace characters are space, tab, line feed, form feed, and carriage return. |
See also | more details | R5RS |
Note | procedure |
|
char<=? |
Form | (char<=? char1 char2) |
Description | This procedure impose - together with the other similar procedures -
a total ordering on the set of characters. It is guaranteed that under this ordering:
The upper case characters are in order.
The lower case characters are in order.
The digits are in order.
Either all the digits precede all the upper case letters, or vice versa.
Either all the digits precede all the lower case letters, or vice versa.
Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates.
|
See also | more details | R5RS |
Note | procedure |
|
char<? |
Form | (char<? char1 char2) |
Description | This procedure imposes - together with the other similar procedures -
a total ordering on the set of characters. It is guaranteed that under this ordering:
The upper case characters are in order.
The lower case characters are in order.
The digits are in order.
Either all the digits precede all the upper case letters, or vice versa.
Either all the digits precede all the lower case letters, or vice versa.
Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates.
|
See also | more details | R5RS |
Note | procedure |
|
char=? |
Form | (char=? char1 char2) |
Description | This procedure impose - together with the other similar procedures -
a total ordering on the set of characters. It is guaranteed that under this ordering:
The upper case characters are in order.
The lower case characters are in order.
The digits are in order.
Either all the digits precede all the upper case letters, or vice versa.
Either all the digits precede all the lower case letters, or vice versa.
Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates.
|
See also | more details | R5RS |
Note | procedure |
|
char>=? |
Form | (char>=? char1 char2) |
Description | This procedure imposes - together with the other similar procedures -
a total ordering on the set of characters. It is guaranteed that under this ordering:
The upper case characters are in order.
The lower case characters are in order.
The digits are in order.
Either all the digits precede all the upper case letters, or vice versa.
Either all the digits precede all the lower case letters, or vice versa.
Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates.
|
See also | more details | R5RS |
Note | procedure |
|
char>? |
Form | (char>? char1 char2) |
Description | This procedure imposes - together with the other similar procedures -
a total ordering on the set of characters. It is guaranteed that under this ordering:
The upper case characters are in order.
The lower case characters are in order.
The digits are in order.
Either all the digits precede all the upper case letters, or vice versa.
Either all the digits precede all the lower case letters, or vice versa.
Some implementations may generalize this procedure to take more than two arguments, as with the corresponding numerical predicates.
|
See also | more details | R5RS |
Note | procedure |
|
char? |
Form | (char? obj) |
Description | Returns #t if obj is a character, otherwise returns #f. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
Parameters | obj | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
close-input-port |
Form | (close-input-port port) |
Description | Closes the file associated with port, rendering the port incapable of delivering or accepting characters.
This procedure has no effect if the file has already been closed. The value returned is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
close-output-port |
Form | (close-output-port port) |
Description | Closes the file associated with port, rendering the port incapable of delivering or accepting characters.
This procedure has no effect if the file has already been closed. The value returned is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
complex? |
Form | (complex? obj) |
Description | This numerical type predicate can be applied to any kind of argument, including non-numbers. It returns #t if the object is of the named type, and otherwise it returns #f. In general, if a type predicate is true of a number then all higher type predicates are also true of that number. Consequently, if a type predicate is false of a number, then all lower type predicates are also false of that number. |
Parameters | obj | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
cond |
Form | (cond (test expression1...) ...) |
Description | A cond expression is evaluated by evaluating the test expressions of successive clauses in order until one of them evaluates to a true value. When a test evaluates to a true value, then the remaining expressions in its clause are evaluated in order, and the result(s) of the last expression in the clause is(are) returned as the result(s) of the entire cond expression. If the selected clause contains only the test and no expressions, then the value of the test is returned as the result. If the selected clause uses the => alternate form, then the expression is evaluated. Its value must be a procedure that accepts one argument; this procedure is then called on the value of the test and the value(s) returned by this procedure is(are) returned by the cond expression. If all tests evaluate to false values, and there is no else clause, then the result of the conditional expression is unspecified; if there is an else clause, then its expressions are evaluated, and the value(s) of the last one is(are) returned. |
See also | more details | R5RS |
Note | syntax |
|
cons |
Form | (cons obj1 obj2) |
Description | Returns a newly allocated pair whose car is obj1 and whose cdr is obj2. The pair is guaranteed to be different (in the sense of eqv?) from every existing object. |
Parameters | obj1 | Any kind of Scheme object |
obj2 | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
cos |
Form | (cos z) |
Description | Computes the cosine of z |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
current-input-port |
Form | (current-input-port) |
Description | Returns the current default input port. |
See also | more details | R5RS |
Note | procedure |
|
current-output-port |
Form | (current-output-port) |
Description | Returns the current default output port. |
See also | more details | R5RS |
Note | procedure |
|
define |
Form | (define variable expression) |
Description | Definitions are valid in some, but not all, contexts where expressions are allowed. They are valid only at the top level of a program> and at the beginning of a body. - Define forms may, in addition to the form shown above, also
be (define (variable formals) body) or (define (variable . formal) body) both of which are defining procedures. |
See also | more details | R5RS |
Note | syntax |
|
define-syntax |
Form | (define-syntax keyword transformer-spec) |
Description | Keyword is an identifier, and the transformer spec should be an instance of syntax-rules.
The top-level syntactic environment is extended by binding the keyword to the specified transformer. -
There is no define-syntax analogue of internal definitions. -
Although macros may expand into definitions and syntax definitions in any context that permits them, it is an error for a definition or syntax definition to shadow a syntactic keyword whose meaning is needed to determine whether some form in the group of forms that contains the shadowing definition is in fact a definition, or, for internal definitions, is needed to determine the boundary between the group and the expressions that follow the group. |
See also | more details | R5RS |
Note | syntax |
|
delay |
Form | (delay expression) |
Description | The delay construct is used together with the procedure force to implement lazy evaluation or call by need. (delay expression) returns an object called a promise which at some point in the future may be asked (by the force procedure) to evaluate expression, and deliver the resulting value. The effect of expression returning multiple values is unspecified. |
See also | more details | R5RS |
Note | syntax |
|
denominator |
Form | (denominator q) |
Description | This procedure returns the denominator of its argument; the result is computed as if the argument was represented as a fraction in lowest terms. The denominator is always positive. The denominator of 0 is defined to be 1. |
Parameters | q | A rational number |
See also | more details | R5RS |
Note | procedure |
|
display |
Form | (display obj [port]) |
Description | Writes a representation of obj to the given port. Strings that appear in the written representation are not enclosed in doublequotes, and no characters are escaped within those strings. Character objects appear in the representation as if written by write-char instead of by write. Display returns an unspecified value. The port argument may be omitted, in which case it defaults to the value returned by current-output-port. |
Parameters | obj | Any kind of Scheme object |
port | An open output port |
See also | more details | R5RS |
Note | procedure |
|
do |
Form | (do ((variable1 init1 step1) ...) (test expression ...) command ...) |
Description | Do is an iteration construct. It specifies a set of variables to be bound, how they are to be initialized at the start, and how they are to be updated on each iteration. When a termination condition is met, the loop exits after evaluating the expressions. -
Do expressions are evaluated as follows: The init expressions are evaluated (in some unspecified order), the variables are bound to fresh locations, the results of the init expressions are stored in the bindings of the variables, and then the iteration phase begins. -
Each iteration begins by evaluating test; if the result is false, then the command expressions are evaluated in order for effect, the step expressions are evaluated in some unspecified order, the variables are bound to fresh locations, the results of the steps are stored in the bindings of the variables, and the next iteration begins. -
If test evaluates to a true value, then the expressions are evaluated from left to right and the value(s) of the last expression is(are) returned. If no expressions are present, then the value of the do expression is unspecified. -
The region of the binding of a variable consists of the entire do expression except for the inits. It is an error for a variable to appear more than once in the list of do variables. -
A step may be omitted, in which case the effect is the same as if (variable init variable) had been written instead of (variable init). |
See also | more details | R5RS |
Note | syntax |
|
eof-object? |
Form | (eof-object? obj) |
Description | Returns #t if obj is an end of file object, otherwise returns #f. The precise set of end of file objects will vary among implementations, but in any case no end of file object will ever be an object that can be read in using read. |
Parameters | obj | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
eq? |
Form | (eq? obj1 obj2) |
Description | Eq? is similar to eqv? except that in some cases it is capable of discerning distinctions
finer than those detectable by eqv?. eq? and eqv? are guaranteed to have the same behavior
on symbols, booleans, the empty list, pairs, procedures, and non-empty strings and vectors.
`Eq?'s behavior on numbers and characters is implementation-dependent, but it will always
return either true or false, and will return true only when eqv? would also return true.
Eq? may also behave differently from eqv? on empty vectors and empty strings. |
Parameters | obj1 | Any kind of Scheme object |
obj2 | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
equal? |
Form | (equal? obj1 obj2) |
Description | Equal? recursively compares the contents of pairs, vectors, and strings, applying eqv? on other objects such as numbers and symbols. A rule of thumb is that objects are generally equal? if they print the same. Equal? may fail to terminate if its arguments are circular data structures. |
Parameters | obj1 | Any kind of Scheme object |
obj2 | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
eqv? |
Form | (eqv? obj1 obj2) |
Description | The eqv? procedure defines a useful equivalence relation on objects. Briefly, it returns #t if obj1 and obj2 should normally be regarded as the same object. This relation is left slightly open to interpretation, but the following partial specification of eqv? holds for all implementations of Scheme. -
The eqv? procedure returns #t if:
(1) obj1 and obj2 are both #t or both #f, or if
(2) obj1 and obj2 are both symbols and (string=? (symbol->string obj1)(symbol->string obj2)) ==> #t.
(3) obj1 and obj2 are both numbers, are numerically equal, and are either both exact or both inexact.
(4) obj1 and obj2 are both characters and are the same character according to the char=? procedure.
(5) both obj1 and obj2 are the empty list.
(6) obj1 and obj2 are pairs, vectors, or strings that denote the same locations in the store (section see section 3.4 Storage model).
(7) obj1 and obj2 are procedures whose location tags are equal (section see section 4.1.4 Procedures). ---
The eqv? procedure returns #f if:
(1) obj1 and obj2 are of different types (section see section 3.2 Disjointness of types).
(2) one of obj1 and obj2 is #t but the other is #f.
(3) obj1 and obj2 are symbols but (string=? (symbol->string obj1) (symbol->string obj2)) ==> #f.
(4) one of obj1 and obj2 is an exact number but the other is an inexact number.
(5) obj1 and obj2 are numbers for which the = procedure returns #f.
(6) obj1 and obj2 are characters for which the char=? procedure returns #f.
(7) one of obj1 and obj2 is the empty list but the other is not.
(8) obj1 and obj2 are pairs, vectors, or strings that denote distinct locations.
(9) obj1 and obj2 are procedures that would behave differently (return different value(s) or have different side effects) for some arguments. |
Parameters | obj1 | Any kind of Scheme object |
obj2 | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
eval |
Form | (eval expression environment-specifier) |
Description | Evaluates expression in the specified environment and returns its value. Expression must be a valid Scheme expression represented as data, and environment-specifier must be a value returned by one of the three procedures described below. Implementations may extend eval to allow non-expression programs (definitions) as the first argument and to allow other values as environments, with the restriction that eval is not allowed to create new bindings in the environments associated with null-environment or scheme-report-environment. |
See also | more details | R5RS |
Note | procedure |
|
even? |
Form | (even? n) |
Description | Computes if n is an even number |
See also | more details | R5RS |
Note | procedure |
|
exact->inexact |
Form | (exact->inexact z) |
Description | Exact->inexact returns an inexact representation of z. The value returned is the inexact number that is numerically closest to the argument. If an exact argument has no reasonably close inexact equivalent, then a violation of an implementation restriction may be reported. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
exact? |
Form | (exact? z) |
Description | This numerical predicate provides a test for the exactness of a quantity. For any Scheme number, precisely one of exact? and inexact? is true. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
exp |
Form | (exp z) |
Description | One of the usual transcendental functions. Compute the exponential function on z |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
expt |
Form | (expt z1 z2) |
Description | Returns z1 raised to the power z2 |
Parameters | z1 | A complex number |
z2 | A complex number |
See also | more details | R5RS |
Note | procedure |
|
floor |
Form | (floor x) |
Description | Floor returns the largest integer not larger than x. |
Parameters | x | A real number |
See also | more details | R5RS |
Note | procedure |
|
for-each |
Form | (for-each proc list1 list2...) |
Description | The arguments to for-each are like the arguments to map, but for-each calls proc for its side effects rather than for its values. Unlike map, for-each is guaranteed to call proc on the elements of the lists in order from the first element(s) to the last, and the value returned by for-each is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
force |
Form | (force promise) |
Description | Forces the value of promise (cf. delay). If no value has been computed for the promise, then a value is computed and returned. The value of the promise is cached (or memoized) so that if it is forced a second time, the previously computed value is returned. |
See also | more details | R5RS |
Note | procedure |
|
gcd |
Form | (gcd n1 ...) |
Description | These procedures return the greatest common divisor of their arguments. The result is always non-negative. (gcd) = 0. |
See also | more details | R5RS |
Note | procedure |
|
if |
Form | (if test consequent [alternate]) |
Description | An if expression is evaluated as follows: first, test is evaluated. If it yields a true value, then consequent is evaluated and its value(s) is(are) returned. Otherwise alternate is evaluated and its value(s) is(are) returned. If test yields a false value and no alternate is specified, then the result of the expression is unspecified. |
See also | more details | R5RS |
Note | syntax |
|
imag-part |
Form | (imag-part z) |
Description | Return the imaginary part of a complex number. Thus, (imag-part z) = x2 if z is (make-rectangular x1 x2) |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
inexact->exact |
Form | (inexact->exact z) |
Description | Inexact->exact returns an exact representation of z. The value returned is the exact number that is numerically closest to the argument. If an inexact argument has no reasonably close exact equivalent, then a violation of an implementation restriction may be reported. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
inexact? |
Form | (inexact? z) |
Description | This numerical predicate provides tests for the exactness of a quantity. For any Scheme number, precisely one of the inexact? and the exact? predicates is true. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
input-port? |
Form | (input-port? obj) |
Description | Returns #t if obj is an input port otherwise returns #f. |
Parameters | obj | Any kind of Scheme object |
Returns | |
See also | more details | R5RS |
Note | procedure |
|
integer->char |
Form | (integer->char n) |
Description | Given an exact integer that is the image of a character under char->integer, integer->char returns that character. These procedures implement order-preserving isomorphisms between the set of characters under the char<=? ordering and some subset of the integers under the <= ordering. |
See also | more details | R5RS |
Note | procedure |
|
integer? |
Form | (integer? obj) |
Description | This numerical type predicate can be applied to any kind of argument, including non-numbers. It returns #t if the object is of the integer type, and otherwise they return #f. In general, if a type predicate is true of a number then all higher type predicates are also true of that number. Consequently, if a type predicate is false of a number, then all lower type predicates are also false of that number. |
Parameters | obj | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
interaction-environment |
Form | (interaction-environment) |
Description | This procedure returns a specifier for the environment that contains implementation-defined bindings, typically a superset of those listed in the report. The intent is that this procedure will return the environment in which the implementation would evaluate expressions dynamically typed by the user. |
See also | more details | R5RS |
Note | procedure |
|
lambda |
Form | (lambda formals body) |
Description | A lambda expression evaluates to a procedure. The environment in effect when the lambda expression was evaluated is remembered as part of the procedure. When the procedure is later called with some actual arguments, the environment in which the lambda expression was evaluated will be extended by binding the variables in the formal argument list to fresh locations, the corresponding actual argument values will be stored in those locations, and the expressions in the body of the lambda expression will be evaluated sequentially in the extended environment. The result(s) of the last expression in the body will be returned as the result(s) of the procedure call. |
See also | more details | R5RS |
Note | syntax |
|
lcm |
Form | (lcm n1) |
Description | This procedure returns the least common multiple of their arguments. The result is always non-negative. |
See also | more details | R5RS |
Note | procedure |
|
length |
Form | (length list) |
Description | Returns the length of list |
See also | more details | R5RS |
Note | procedure |
|
let |
Form | (letsyntax ((keyword transformer spec) ...) body |
Description | Each keyword is an identifier, each transformer spec is an instance of syntax-rules, and body should be a sequence of one or more expressions. It is an error for a keyword to appear more than once in the list of keywords being bound. --
The body is expanded in the syntactic environment obtained by extending the syntactic environment of the let-syntax expression with macros whose keywords are the keywords, bound to the specified transformers. Each binding of a keyword has body as its region. |
See also | more details | R5RS |
Note | syntax |
|
let* |
Form | (let* ((variable1 init1) ...) body) |
Description | Let* is similar to let, but the bindings are performed sequentially from left to right, and the region of a binding indicated by (variable init) is that part of the let* expression to the right of the binding. Thus the second binding is done in an environment in which the first binding is visible, and so on. |
See also | more details | R5RS |
Note | syntax |
|
let-syntax |
Form | (let-syntax ((variable1 init1) ...) body) |
Description | Body should be a sequence of one or more expressions. It is an error for a variable to appear more than once in the list of variables being bound. --
The variables are bound to fresh locations holding undefined values, the inits are evaluated in the resulting environment (in some unspecified order), each variable is assigned to the result of the corresponding init, the body is evaluated in the resulting environment, and the value(s) of the last expression in body is(are) returned. Each binding of a variable has the entire letrec expression as its region, making it possible to define mutually recursive procedures. |
See also | more details | R5RS |
Note | syntax |
|
letrec |
Form | (letrec ((variable1 init1) ...) body) |
Description | Body should be a sequence of one or more expressions. It is an error for a variable to appear more than once in the list of variables being bound. --
The variables are bound to fresh locations holding undefined values, the inits are evaluated in the resulting environment (in some unspecified order), each variable is assigned to the result of the corresponding init, the body is evaluated in the resulting environment, and the value(s) of the last expression in body is(are) returned. Each binding of a variable has the entire letrec expression as its region, making it possible to define mutually recursive procedures. |
See also | more details | R5RS |
Note | syntax |
|
letrec-syntax |
Form | (letrec-syntax ((keyword transformer spec) ...) body) |
Description | The body is expanded in the syntactic environment obtained by extending the syntactic environment of the letrec-syntax expression with macros whose keywords are the keywords, bound to the specified transformers. Each binding of a keyword has the bindings as well as the body within its region, so the transformers can transcribe expressions into uses of the macros introduced by the letrec-syntax expression. |
See also | more details | R5RS |
Note | syntax |
|
list |
Form | (list obj ...) |
Description | Returns a newly allocated list of its arguments. |
Parameters | obj | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
list->string |
Form | (list->string list) |
Description | List->string returns a newly allocated string formed from the characters in the list list, which must be a list of characters. String->list and list->string are inverses so far as equal? is concerned. |
See also | more details | R5RS |
Note | procedure |
|
list->vector |
Form | (list->vector list) |
Description | Returns a newly created vector initialized to the elements of the list list. |
See also | more details | R5RS |
Note | procedure |
|
list-ref |
Form | (list-ref list k) |
Description | Returns the kth element of list. This is the same as the car of (list-tail list k).
It is an error if list has fewer than k elements. |
See also | more details | R5RS |
Note | procedure |
|
list-tail |
Form | (list-tail list k) |
Description | Returns the sublist of list obtained by omitting the first k elements.
It is an error if list has fewer than k elements. |
See also | more details | R5RS |
Note | procedure |
|
list? |
Form | (list? obj) |
Description | Returns #t if obj is a list, otherwise returns #f.
By definition, all lists have finite length and are terminated by the empty list. |
Parameters | obj | Any kind of Scheme object |
See also | more details | R5RS |
Note | procedure |
|
load |
Form | (load filename) |
Description | Filename should be a string naming an existing file containing Scheme source code. The
load procedure reads expressions and definitions from the file and evaluates them sequentially.
It is unspecified whether the results of the expressions are printed. The load procedure
does not affect the values returned by current-input-port and current-output-port.
Load returns an unspecified value. Rationale: For portability, load must operate
on source files. Its operation on other kinds of files necessarily varies among implementations. |
See also | more details | R5RS |
Note | procedure |
|
log |
Form | (log z) |
Description | Computes the natural logarithm of z (not the base ten logarithm). |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
magnitude |
Form | (magnitude z) |
Description | Assume that z = x3 . e^i x4. This function returns (abs x3). magnitude is the same as abs for a real
argument, but abs must be present in all implementations, whereas magnitude need
only be present in implementations that support general complex numbers. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
make-polar |
Form | (make-polar x3 x4) |
Description | If we assume that x3 . e^i x4 = z, this function returns the complex number z.
|
Parameters | x3 | A real number |
x4 | A real number |
See also | more details | R5RS |
Note | procedure |
|
make-rectangular |
Form | (make-rectangular x1 x2) |
Description | If we assume that x1 + x2i = z, this function returns the complex number z. |
Parameters | x1 | A real number |
x2 | A real number |
See also | more details | R5RS |
Note | procedure |
|
make-string |
Form | (make-string k [char]) |
Description | Make-string returns a newly allocated string of length k. If char is given, then all elements of the string are initialized to char, otherwise the contents of the string are unspecified. |
See also | more details | R5RS |
Note | procedure |
|
make-vector |
Form | (make-vector k [fill]) |
Description | Returns a newly allocated vector of k elements. If a second argument is given, then each element is initialized to fill. Otherwise the initial contents of each element is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
map |
Form | (map proc list1 list2 ...) |
Description | The lists must be lists, and proc must be a procedure taking as many arguments as there are lists and returning a single value. If more than one list is given, then they must all be the same length. Map applies proc element-wise to the elements of the lists and returns a list of the results, in order. The dynamic order in which proc is applied to the elements of the lists is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
max |
Form | (max x1 x2 ...) |
Description | This procedure returns the maximum of its arguments.
If any argument is inexact, then the result will also be inexact (unless the procedure can prove that the inaccuracy is not large enough to affect the result, which is possible only in unusual implementations). If max is used to compare numbers of mixed exactness, and the numerical value of the result cannot be represented as an inexact number without loss of accuracy, then the procedure may report a violation of an implementation restriction.
|
Parameters | x1 | A real number |
x1 | A real number |
See also | more details | R5RS |
Note | procedure |
|
member |
Form | (member obj list) |
Description | This procedure returns the first sublist of list whose car is obj, where the sublists of list are the non-empty lists returned by (list-tail list k) for k less than the length of list. If obj does not occur in list, then #f (not the empty list) is returned. This function uses uses equal? for comparison of elements in the list. |
Parameters | obj | Any kind of Scheme object |
list | A proper list |
See also | more details | R5RS |
Note | procedure |
|
memq |
Form | (memq obj list) |
Description | This procedure returns the first sublist of list whose car is obj, where the sublists of list are the non-empty lists returned by (list-tail list k) for k less than the length of list. If obj does not occur in list, then #f (not the empty list) is returned. memq uses eq? to compare obj with the elements of list'. |
Parameters | obj | Any kind of Scheme object |
list | A proper list |
See also | more details | R5RS |
Note | procedure |
|
memv |
Form | (memv obj list) |
Description | This procedure returns the first sublist of list whose car is obj, where the sublists of list are the non-empty lists returned by (list-tail list k) for k less than the length of list. If obj does not occur in list, then #f (not the empty list) is returned. Memv uses eqv? to compare obj with the elements of list. |
Parameters | obj | Any kind of Scheme object |
list | A proper list |
See also | more details | R5RS |
Note | procedure |
|
min |
Form | (min x1 x2 ...) |
Description | This procedure returns the minimum of its arguments. |
Parameters | x1 | A real number |
x1 | A real number |
See also | more details | R5RS |
Note | procedure |
|
modulo |
Form | (modulo n1 n2) |
Description | Implement number-theoretic (integer) division. n2 should be non-zero. Returns an integer. If n1/n2 is an integer:
(modulo n1 n2) ==> 0.
If n1/n2 is not an integer:
(modulo n1 n2) ==> n_m,
where 0 < |n_m| < |n2|, n_m differ from n1 by a multiple of n2, and n_m has the same sign as n2. |
See also | more details | R5RS |
Note | procedure |
|
negative? |
Form | (negative? x) |
Description | The numerical predicate that tests if x is negative. Returns either #t or #f. |
Parameters | x | A real number |
See also | more details | R5RS |
Note | procedure |
|
newline |
Form | (newline [port]) |
Description | Writes an end of line to port. Exactly how this is done differs from one operating system to another. Returns an unspecified value. The port argument may be omitted, in which case it defaults to the value returned by current-output-port. |
See also | more details | R5RS |
Note | procedure |
|
not |
Form | (not obj) |
Description | Returns #t if obj is false, and returns #f otherwise. |
See also | more details | R5RS |
Note | procedure |
|
null? |
Form | (null? obj) |
Description | Returns #t if obj is the empty list, otherwise returns #f. |
See also | more details | R5RS |
Note | procedure |
|
number->string |
Form | (number->string z [radix]) |
Description | The procedure takes a number and a radix and returns as a string an external representation of the given number in the given radix. |
Parameters | z | A complex number |
radix | An exact integer, 2, 8, 10 or 16. Defaults to 10. |
See also | more details | R5RS |
Note | procedure |
|
number? |
Form | (number? obj) |
Description | This numerical type predicate can be applied to any kind of argument,
including non-numbers. It returns #t if the object is of the named
type, and otherwise they return #f. In general, if a type predicate
is true of a number then all higher type predicates are also true
of that number. Consequently, if a type predicate is false of a number,
then all lower type predicates are also false of that number. No
object satisfies more than one of the following predicates: boolean?,
pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
See also | more details | R5RS |
Note | procedure |
|
numerator |
Form | (numerator q) |
Description | This procedure returns the numerator of this argument; the result is computed as if the argument was represented as a fraction in lowest terms. |
Parameters | q | A rational number |
See also | more details | R5RS |
Note | procedure |
|
odd? |
Form | (odd? n) |
Description | Tests if the given integer n is odd (not even). |
See also | more details | R5RS |
Note | procedure |
|
open-input-file |
Form | (open-input-file filename) |
Description | Takes a string naming an existing file and returns an input port capable of delivering characters from the file. If the file cannot be opened, an error is signalled. |
See also | more details | R5RS |
Note | procedure |
|
open-output-file |
Form | (open-output-file filename) |
Description | Takes a string naming an output file to be created and returns an output port capable of writing characters to a new file by that name. If the file cannot be opened, an error is signalled. If a file with the given name already exists, the effect is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
or |
Form | (or test ...) |
Description | The test expressions are evaluated from left to right, and the value of the first expression
that evaluates to a true value is returned. Any remaining expressions are not evaluated.
If all expressions evaluate to false values, the value of the last expression is returned.
If there are no expressions then #f is returned. |
See also | more details | R5RS |
Note | syntax |
|
output-port? |
Form | (output-port? obj) |
Description | Returns #t if obj is an output port, otherwise returns #f. |
See also | more details | R5RS |
Note | procedure |
|
pair? |
Form | (pair? obj) |
Description | Returns #t if obj is a pair, and otherwise returns #f. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
See also | more details | R5RS |
Note | procedure |
|
peek-char |
Form | (peek-char [port]) |
Description | Returns the next character available from the input port, without updating the port to
point to the following character. If no more characters are available, an end of file
object is returned. Port may be omitted, in which case it defaults to the value returned
by current-input-port. Note: The value returned by a call to peek-char is the same
as the value that would have been returned by a call to read-char with the same port.
The only difference is that the very next call to read-char or peek-char on that
port will return the value returned by the preceding call to peek-char. In particular,
a call to peek-char on an interactive port will hang waiting for input whenever a call
to read-char would have hung. |
See also | more details | R5RS |
Note | procedure |
|
port? |
Form | (port? obj) |
Description | Returns if obj is a port. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
See also | more details | R5RS |
Note | procedure |
|
positive? |
Form | (positive? x) |
Description | Test if x is a positive real number. |
Parameters | x | A real number |
See also | more details | R5RS |
Note | procedure |
|
procedure? |
Form | (procedure? obj) |
Description | Returns #t if obj is a procedure, otherwise returns #f. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
See also | more details | R5RS |
Note | procedure |
|
quasiquote |
Form | (quasiquote template) |
Description | Backquote or quasiquote expressions are useful for constructing a list or vector structure
when most but not all of the desired structure is known in advance. If no commas appear
within the template, the result of evaluating template is equivalent to the result of
evaluating template. If a comma appears within the template, however, the expression
following the comma is evaluated (unquoted) and its result is inserted into the structure
instead of the comma and the expression. If a comma appears followed immediately by an
at-sign (@), then the following expression must evaluate to a list; the opening and closing
parentheses of the list are then stripped away and the elements of the list are inserted
in place of the comma at-sign expression sequence. A comma at-sign should only appear
within a list or vector template. |
See also | more details | R5RS |
Note | syntax |
|
quote |
Form | (quote datum) |
Description | Evaluates to datum. Datum may be any external representation of a Scheme object.
This notation is used to include literal constants in Scheme code. |
See also | more details | R5RS |
Note | syntax |
|
quotient |
Form | (quotient n1 n2) |
Description | This procedure implements number-theoretic (integer) division. n2 should be non-zero. Return an integer.
If n1/n2 is an integer:
(quotient n1 n2) ==> n1/n2.
If n1/n2 is not an integer: (quotient n1 n2) ==> n_q
where n_q is n1/n2 rounded towards zero. |
See also | more details | R5RS |
Note | procedure |
|
rational? |
Form | (rational? obj) |
Description | This numerical type predicate can be applied to any kind of argument, including non-numbers.
It return #t if the object is a rational number, and otherwise it returns #f. In general,
if a type predicate is true of a number then all higher type predicates are also true
of that number. Consequently, if a type predicate is false of a number, then all lower
type predicates are also false of that number. |
See also | more details | R5RS |
Note | procedure |
|
rationalize |
Form | (rationalize x y) |
Description | Returns the simplest rational number differing from x by no more than y |
Parameters | x | A real number |
y | A real number |
See also | more details | R5RS |
Note | procedure |
|
read |
Form | (read [port]) |
Description | Read converts external representations of Scheme objects into the objects themselves. That is, it is a parser for the nonterminal datum. Read returns the next object parsable from the given input port, updating port to point to the first character past the end of the external representation of the object. -
If an end of file is encountered in the input before any characters are found that can begin an object, then an end of file object is returned. The port remains open, and further attempts to read will also return an end of file object. If an end of file is encountered after the beginning of an object's external representation, but the external representation is incomplete and therefore not parsable, an error is signalled. -
The port argument may be omitted, in which case it defaults to the value returned by current-input-port. It is an error to read from a closed port. |
See also | more details | R5RS |
Note | procedure |
|
read-char |
Form | (read-char [port]) |
Description | Returns the next character available from the input port, updating the port to point
to the following character. If no more characters are available, an end of file object
is returned. Port may be omitted, in which case it defaults to the value returned by
current-input-port. |
See also | more details | R5RS |
Note | procedure |
|
real-part |
Form | (real-part z) |
Description | Return the real part of a complex number z. Suppose x1 and x2 are real numbers and z is a complex number such that
z = x1 + x2i. real-part returns x1 when applied on z. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
real? |
Form | (real? obj) |
Description | This numerical type predicate can be applied to any kind of argument, including non-numbers. It returns #t if the object is of the named type, and otherwise it returns #f. In general, if a type predicate is true of a number then all higher type predicates are also true of that number. Consequently, if a type predicate is false of a number, then all lower type predicates are also false of that number. |
See also | more details | R5RS |
Note | procedure |
|
remainder |
Form | (remainder n1 n2) |
Description | This procedure implements number-theoretic (integer) division. n2 should be non-zero. Returns an integer.
If n1/n2 is an integer:
(remainder n1 n2) ==> 0.
If n1/n2 is not an integer:
(remainder n1 n2) ==> n_r
0 < |n_r| < |n2|, 0 < |n_m| < |n2|, and n_r and n_m differ from n1 by a multiple of n2, n_r has the same sign as n1, and n_m has the same sign as n2. |
See also | more details | R5RS |
Note | procedure |
|
reverse |
Form | (reverse list) |
Description | Returns a newly allocated list consisting of the elements of list in reverse order. |
See also | more details | R5RS |
Note | procedure |
|
round |
Form | (round x) |
Description | Returns the closest integer to x, rounding to even when x is halfway between two integers. |
Parameters | x | A real number |
See also | more details | R5RS |
Note | procedure |
|
set! |
Form | (set! variable expression) |
Description | Expression is evaluated, and the resulting value is stored in the location to which variable is bound. Variable must be bound either in some region enclosing the set! expression or at top level. The result of the set! expression is unspecified. |
See also | more details | R5RS |
Note | syntax |
|
set-car! |
Form | (set-car! pair obj) |
Description | Stores obj in the car field of pair. The value returned by set-car! is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
set-cdr! |
Form | (set-cdr! pair obj) |
Description | Stores obj in the cdr field of pair. The value returned by set-cdr! is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
sin |
Form | (sin z) |
Description | Returns the sinus of the complex number z |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
sqrt |
Form | (sqrt z) |
Description | Returns the principal square root of z. The result will have either positive real part,
or zero real part and non-negative imaginary part. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
string |
Form | (string char ...) |
Description | Returns a newly allocated string composed of the arguments. |
See also | more details | R5RS |
Note | procedure |
|
string->list |
Form | (string->list string) |
Description | Returns a newly allocated list of the characters that make up the given string. |
See also | more details | R5RS |
Note | procedure |
|
string->number |
Form | (string->number string [radix]) |
Description | Returns a number of the maximally precise representation expressed by the given string.
Radix must be an exact integer, either 2, 8, 10, or 16. If supplied, radix is a default
radix that may be overridden by an explicit radix prefix in string (e.g. #o177).
If radix is not supplied, then the default radix is 10. If string is not a syntactically
valid notation for a number, then string->number returns #f. |
See also | more details | R5RS |
Note | procedure |
|
string->symbol |
Form | (string->symbol string) |
Description | Returns the symbol whose name is string. This procedure can create symbols with names containing
special characters or letters in the non-standard case, but it is usually a bad idea to create
such symbols because in some implementations of Scheme they cannot be read as themselves. |
See also | more details | R5RS |
Note | procedure |
|
string-append |
Form | (string-append string ...) |
Description | Returns a newly allocated string whose characters form the concatenation of the given strings. |
See also | more details | R5RS |
Note | procedure |
|
string-ci<=? |
Form | (string-ci<=? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci<=? is the lexicographic ordering on strings induced
by the ordering char-ci<=? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string-ci<? |
Form | (string-ci<? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci<? is the lexicographic ordering on strings induced
by the ordering char-ci<? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string-ci=? |
Form | (string-ci=? string1 string2) |
Description | Returns #t if the two strings are the same length and contain the same characters in the same positions, otherwise returns #f. Treats upper and lower case letters as though they were the same character. |
See also | more details | R5RS |
Note | procedure |
|
string-ci>=? |
Form | (string-ci>=? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci>=? is the lexicographic ordering on strings induced
by the ordering char-ci>=? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string-ci>? |
Form | (string-ci>? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci>? is the lexicographic ordering on strings induced
by the ordering char-ci>? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string-copy |
Form | (string-copy string) |
Description | Returns a newly allocated copy of the given string |
See also | more details | R5RS |
Note | procedure |
|
string-fill! |
Form | (string-fill! string char) |
Description | Stores char in every element of the given string and returns an unspecified value. |
See also | more details | R5RS |
Note | procedure |
|
string-length |
Form | /string-length string) |
Description | Returns the number of characters in string. |
See also | more details | R5RS |
Note | procedure |
|
string-ref |
Form | (string-ref string k) |
Description | Returns character k of string using zero-origin indexing. k must be a valid index of string. |
See also | more details | R5RS |
Note | procedure |
|
string-set! |
Form | (string-set! string k char) |
Description | Stores char in element k of string and returns an unspecified value. k must be a valid index of string. |
See also | more details | R5RS |
Note | procedure |
|
string<=? |
Form | (string<=? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci<=? is the lexicographic ordering on strings induced
by the ordering char-ci<=? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string<? |
Form | (string<? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci<? is the lexicographic ordering on strings induced
by the ordering char-ci<? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string=? |
Form | (string=? string1 string2) |
Description | Returns #t if the two strings are the same length and contain the same characters in
the same positions, otherwise returns #f. |
See also | more details | R5RS |
Note | procedure |
|
string>=? |
Form | (string>=? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci>=? is the lexicographic ordering on strings induced
by the ordering char-ci>=? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string>? |
Form | (string>? string1 string2) |
Description | This procedure is a lexicographic extension to strings of the corresponding orderings
on characters. string-ci>? is the lexicographic ordering on strings induced
by the ordering char-ci>? on characters. If two strings differ in length but are the same
up to the length of the shorter string, the shorter string is considered to be lexicographically
less than the longer string. |
See also | more details | R5RS |
Note | procedure |
|
string? |
Form | (string? obj) |
Description | Returns #t if obj is a string, otherwise returns #f. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
See also | more details | R5RS |
Note | procedure |
|
substring |
Form | (substring string start end) |
Description | String must be a string, and start and end must be exact integers satisfying
0 <= start <= end <= (string-length string).
Returns a newly allocated string formed from the characters of string beginning with index start
(inclusive) and ending with index end (exclusive). |
See also | more details | R5RS |
Note | procedure |
|
symbol->string? |
Form | (symbol->string? symbol) |
Description | Returns the name of symbol as a string. If the symbol was part of an object returned as the value
of a literal expression or by a call to the read
procedure, and its name contains alphabetic characters, then the string returned will contain characters
in the implementation's preferred standard case--some implementations will prefer upper case, others
lower case. If the symbol was returned by string->symbol, the case of characters in the string
returned will be the same as the case in the string that was passed to string->symbol. It is
an error to apply mutation procedures like string-set! to strings returned by this procedure. |
See also | more details | R5RS |
Note | procedure |
|
symbol? |
Form | (symbol? obj) |
Description | Returns #t if obj is a symbol, otherwise returns #f. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
See also | more details | R5RS |
Note | procedure |
|
syntax-rules |
Form | (syntax-rules literals (pattern template)...) |
Description | The <pattern> in a <syntax rule> is a list <pattern> that begins with the keyword for the macro. -
A <pattern> is either an identifier, a constant, or one of the following
(<pattern> ...),
(<pattern> <pattern> ... . <pattern>),
(<pattern> ... <pattern> <ellipsis>),
#(<pattern> ...), or
#(<pattern> ... <pattern> <ellipsis>).
A template is either an identifier, a constant, or one of the following
(<element> ...),
(<element> <element> ... . <template>), or
#(<element> ...)
where an <element> is a <template> optionally followed by an <ellipsis> and an <ellipsis> is the identifier '...' (which cannot be used as an identifier in either a template or a pattern).-
Semantics: An instance of syntax-rules produces a new macro transformer by specifying a sequence of hygienic rewrite rules. A use of a macro whose keyword is associated with a transformer specified by syntax-rules is matched against the patterns contained in the <syntax rule>s, beginning with the leftmost <syntax rule>. When a match is found, the macro use is transcribed hygienically according to the template.-
An identifier that appears in the pattern of a <syntax rule> is a pattern variable, unless it is the keyword that begins the pattern, is listed in <literals>, or is the identifier .... Pattern variables match arbitrary input elements and are used to refer to elements of the input in the template. It is an error for the same pattern variable to appear more than once in a <pattern>.-
The keyword at the beginning of the pattern in a <syntax rule> is not involved in the matching and is not considered a pattern variable or literal identifier.-
Rationale: The scope of the keyword is determined by the expression or syntax definition that binds it to the associated macro transformer. If the keyword were a pattern variable or literal identifier, then the template that follows the pattern would be within its scope regardless of whether the keyword were bound by let-syntax or by letrec-syntax. -
Identifiers that appear in <literals> are interpreted as literal identifiers to be matched against corresponding subforms of the input. A subform in the input matches a literal identifier if and only if it is an identifier and either both its occurrence in the macro expression and its occurrence in the macro definition have the same lexical binding, or the two identifiers are equal and both have no lexical binding.-
A subpattern followed by ... can match zero or more elements of the input. It is an error for ... to appear in <literals>. Within a pattern the identifier ... must follow the last element of a nonempty sequence of subpatterns. |
See also | more details | R5RS |
Note | syntax |
|
tan |
Form | (tan z) |
Description | Returns the tangens of z |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|
transcript-off |
Form | (transcript-off filename) |
Description | Closes a transcript file, which is opened by transcipt-on |
See also | more details | R5RS |
Note | procedure |
|
transcript-on |
Form | (transcript-on filename) |
Description | Filename must be a string naming an output file to be created. The effect of transcript-on is to open the named file for output, and to cause a transcript of subsequent interaction between the user and the Scheme system to be written to the file. The transcript is ended by a call to transcript-off. Only one transcript may be in progress at any time, though some implementations may relax this restriction. The values returned by these procedures are unspecified. |
See also | more details | R5RS |
Note | optional procedure |
|
truncate |
Form | (truncate x) |
Description | Returns the integer closest to x whose absolute value is not larger than the absolute value of x. |
Parameters | x | A real number |
See also | more details | R5RS |
Note | procedure |
|
unquote |
Form | (unquote datum) |
Description | Syntactic notation for ,datum within a quasiquote (backquote) context |
See also | more details | R5RS |
Note | syntax |
|
unquote-splicing |
Form | (unquote-splicing datum) |
Description | Syntactic notation for ,@datum within a quasiquote (backquote) context |
See also | more details | R5RS |
Note | syntax |
|
values |
Form | (values obj ...) |
Description | Delivers all of its arguments to its continuation. Except for continuations created by the call-with-values procedure, all continuations take exactly one value. |
See also | more details | R5RS |
Note | procedure |
|
vector |
Form | (vector obj ...) |
Description | Returns a newly allocated vector whose elements contain the given arguments. Analogous to list. |
See also | more details | R5RS |
Note | procedure |
|
vector->list |
Form | (vector->list vector) |
Description | Returns a newly allocated list of the objects contained in the elements of vector. |
See also | more details | R5RS |
Note | procedure |
|
vector-fill! |
Form | (vector-fill! vector fill) |
Description | Stores fill in every element of vector. The value returned by vector-fill! is unspecified. |
See also | more details | R5RS |
Note | procedure |
|
vector-length |
Form | (vector-length vector) |
Description | Returns the number of elements in vector as an exact integer. |
See also | more details | R5RS |
Note | procedure |
|
vector-ref |
Form | (vector-ref vector k) |
Description | Returns the contents of element k of vector. k must be a valid index of vector. |
See also | more details | R5RS |
Note | procedure |
|
vector-set! |
Form | (vector-set! vector k obj) |
Description | Stores obj in element k of vector. The value returned by vector-set! is unspecified. k must be a valid index of vector. |
See also | more details | R5RS |
Note | procedure |
|
vector? |
Form | (vector? obj) |
Description | Returns #t if obj is a vector, otherwise returns #f. No object satisfies more than one of the
following predicates: boolean?, pair?, symbol?, number?, char?, string?, vector?, port?, procedure? |
See also | more details | R5RS |
Note | procedure |
|
with-input-from-file |
Form | (with-input-from-file string thunk) |
Description | String should be a string naming a file, and thunk should be a procedure of no arguments.
The file should already exist; The file is opened for input, an input port connected to
it is made the default value returned by
current-input-port (and is used by (read), (write obj), and
so forth), and the thunk is called with no arguments. When the thunk returns, the port
is closed and the previous default is restored. With-input-from-file
returns the value yielded by thunk. If an escape procedure is used to escape from
the continuation of this procedure, its behavior is implementation dependent. |
See also | more details | R5RS |
Note | procedure |
|
with-output-to-file |
Form | (with-output-to-file string thunk) |
Description | String should be a string naming a file, and thunk should be a procedure of no arguments.
For with-output-to-file,
the effect is unspecified if the file already exists. The file is opened for
output, an output port connected to it is made the default value returned by
current-input-port or current-output-port (and is used by (read), (write obj), and
so forth), and the thunk is called with no arguments. When the thunk returns, the port
is closed and the previous default is restored. with-output-to-file
return(s) the value(s) yielded by thunk. If an escape procedure is used to escape from
the continuation of this procedure, its behavior is implementation dependent. |
See also | more details | R5RS |
Note | procedure |
|
write |
Form | (write obj [port]) |
Description | Writes a written representation of obj to the given port. Strings that appear in the
written representation are enclosed in doublequotes, and within those strings backslash
and doublequote characters are escaped by backslashes. Character objects are written
using the #\ notation. Write returns an unspecified value. The port argument may
be omitted, in which case it defaults to the value returned by |
See also | more details | R5RS |
Note | procedure |
|
write-char |
Form | (write-char char [port]) |
Description | Writes the character char (not an external representation of the character) to the given port and returns an unspecified value. The port argument may be omitted, in which case it defaults to the value returned by current-output-port. |
See also | more details | R5RS |
Note | procedure |
|
zero? |
Form | (zero? z) |
Description | This numerical predicate tests a number for being zero. It returns either #t or #f. |
Parameters | z | A complex number |
See also | more details | R5RS |
Note | procedure |
|