More docs

This commit is contained in:
Justin Ethier 2021-03-30 17:16:55 -04:00
parent 2852334f18
commit 3fc509cb4d

View file

@ -1001,6 +1001,8 @@ The `memv` procedure is the same as `member` but uses `eqv?` to compare `obj` wi
(modulo a b) (modulo a b)
Return the integer remainder after dividing `a` by `b`.
# negative? # negative?
(negative? n) (negative? n)
@ -1013,34 +1015,51 @@ Returns `#t` if `n` is a negative number and `#f` otherwise. It is an error if `
(newline port) (newline port)
Write a newline to `port`, or the current output port if no argument is given.
# not # not
(not x) (not x)
The `not` procedure returns `#t` if `x` is false, and returns `#f` otherwise.
# numerator # numerator
(numerator n) n) (numerator n)
Return the numerator of `n`.
# odd? # odd?
(odd? num) (odd? num)
Return `#t` if `num` is an odd number and `#f` otherwise.
# open-input-bytevector # open-input-bytevector
(open-input-bytevector bv) (open-input-bytevector bv)
Takes a bytevector and returns a binary input port that delivers bytes from the bytevector.
# open-input-string # open-input-string
(open-input-string string) (open-input-string string)
Takes a string and returns a textual input port that delivers
characters from the string.
# open-output-bytevector # open-output-bytevector
(open-output-bytevector open-output-string) (open-output-bytevector open-output-string)
Returns a binary output port that will accumulate bytes for retrieval by `get-output-bytevector`.
# open-output-string # open-output-string
(open-output-string) (open-output-string)
Returns a textual output port that will accumulate characters for retrieval by `get-output-string`.
# or # or
*Syntax* *Syntax*
@ -1059,10 +1078,14 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(output-port-open? port) (output-port-open? port)
Returns `#t` if `port` is an open output port, and `#f` otherwise.
# output-port? # output-port?
(output-port? obj) (output-port? obj)
Returns `#t` if `obj` is an output port, and `#f` otherwise.
# parameterize # parameterize
*Syntax* *Syntax*
@ -1075,6 +1098,8 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(positive? n) (positive? n)
Returns `#t` if `n` is a positive number and `#f` otherwise.
# quasiquote # quasiquote
*Syntax* *Syntax*
@ -1085,30 +1110,52 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(quotient x y) (quotient x y)
Return the quotient of dividing `x` by `y`.
# raise # raise
(raise obj) (raise obj)
Raises an exception by invoking the current exception handler on `obj`.
The handler is called with the same dynamic environment as that of the call to `raise`, except that the current exception handler is the one that was in place when the handler being called was installed. If the handler returns, a secondary exception is raised in the same dynamic environment as the handler.
# raise-continuable # raise-continuable
(raise-continuable obj) (raise-continuable obj)
Raises an exception by invoking the current exception handler on `obj`.
The handler is called with the same dynamic
environment as the call to `raise-continuable`, except
that: (1) the current exception handler is the one that was
in place when the handler being called was installed, and
(2) if the handler being called returns, then it will again
become the current exception handler. If the handler returns, the values it returns become the values returned by
the call to `raise-continuable`.
# rational? # rational?
(rational? obj) (rational? obj)
Returns `#t` if `obj` is a rational number and `#f` otherwise.
# read-line # read-line
(read-line) (read-line)
(read-line port) (read-line port)
Read a line of text from the current input port or `port` if specified.
# read-string # read-string
(read-string k) (read-string k)
(read-string k port) (read-string k port)
Read a string from the current input port or `port` if specified.
# receive # receive
*Syntax* *Syntax*
@ -1119,18 +1166,26 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(record? obj) (record? obj)
Returns `#t` if `obj` is a record type and `#f` otherwise.
# remainder # remainder
(remainder num1 num2) (remainder num1 num2)
Returns the remainder of dividing `num1` by `num2`.
# reverse # reverse
(reverse lst) (reverse lst)
Returns a newly allocated list that is the reverse of `lst`.
# round # round
(round z) (round z)
Returns the closest integer to `z`.
# slot-set! # slot-set!
(slot-set! name obj idx val) (slot-set! name obj idx val)
@ -1139,10 +1194,14 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(square z) (square z)
Returns the square of `z`.
# string # string
(string char ...) (string char ...)
Returns a string containing the given characters.
# string->list # string->list
(string->list string) (string->list string)
@ -1151,6 +1210,8 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(string->list string start end) (string->list string start end)
Returns a newly allocated list containing the characters of `string`.
# string->utf8 # string->utf8
(string->utf8 string) (string->utf8 string)
@ -1159,6 +1220,8 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(string->utf8 string start end) (string->utf8 string start end)
Returns a newly allocated bytevector containing the UTF-8 bytecodes of `string`.
# string->vector # string->vector
(string->vector string) (string->vector string)
@ -1167,6 +1230,8 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(string->vector string start end) (string->vector string start end)
Returns a newly allocated vector containing the contents of `string`.
# string-copy # string-copy
(string-copy string) (string-copy string)
@ -1175,6 +1240,8 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(string-copy string end) (string-copy string end)
Returns a copy of `string`.
# string-copy! # string-copy!
(string-copy! to at from) (string-copy! to at from)
@ -1183,6 +1250,14 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(string-copy! to at from start end) (string-copy! to at from start end)
Copies the characters of `string` from between `start` and `end`
to string `to`, starting at `at`.
(define a "12345")
(define b (string-copy "abcde"))
(string-copy! b 1 a 0 2)
b => "a12de"
# string-fill! # string-fill!
(string-fill! str fill) (string-fill! str fill)
@ -1191,14 +1266,20 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(string-fill! str fill start end) (string-fill! str fill start end)
The `string-fill!` procedure stores `fill` in the elements of `str` between `start` and `end`.
# string-for-each # string-for-each
(string-for-each proc string1 string2 ...) (string-for-each proc string1 string2 ...)
`string-for-each` is like `for-each` but the arguments consist of strings instead of lists.
# string-map # string-map
(string-map proc string1 string2 ...) (string-map proc string1 string2 ...)
`string-maph` is like `map` but the arguments consist of strings instead of lists.
# string<=? # string<=?
(string<=? str1 str2) (string<=? str1 str2)
@ -1211,6 +1292,8 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(string=? str1 str2) (string=? str1 str2)
Returns `#t` if all of the given strings are equal and false otherwise.
# string>=? # string>=?
(string>=? str1 str2) (string>=? str1 str2)
@ -1223,6 +1306,8 @@ Semantics: The `{test}` expressions are evaluated from left to right, and the va
(symbol=? symbol1 symbol2 symbol3 ...) (symbol=? symbol1 symbol2 symbol3 ...)
Returns `#t` if all of the arguments are the same symbol and `#f` otherwise.
# syntax-error # syntax-error
*Syntax* *Syntax*
@ -1271,14 +1356,20 @@ Semantics: The `test` is evaluated, and if it evaluates to `#f`, the expressions
(utf8->string bytevector start end) (utf8->string bytevector start end)
Convert bytecodes in the given `bytevector` to a string.
# values # values
(values obj ...) (values obj ...)
Return arguments received as multiple values.
# vector # vector
(vector obj ...) (vector obj ...)
`vector` returns a vector of its arguments.
# vector->list # vector->list
(vector->list vector) (vector->list vector)
@ -1287,6 +1378,8 @@ Semantics: The `test` is evaluated, and if it evaluates to `#f`, the expressions
(vector->list vector start end) (vector->list vector start end)
Return a newly-allocated list containing the contents of `vector`.
# vector->string # vector->string
(vector->string vector) (vector->string vector)
@ -1295,10 +1388,14 @@ Semantics: The `test` is evaluated, and if it evaluates to `#f`, the expressions
(vector->string vector start end) (vector->string vector start end)
Return a newly-allocated string containing the contents of `vector`.
# vector-append # vector-append
(vector-append vector ...) (vector-append vector ...)
Returns a newly allocated vector whose elements are the concatenation of the elements of the given vectors.
# vector-copy # vector-copy
(vector-copy vector) (vector-copy vector)
@ -1307,6 +1404,11 @@ Semantics: The `test` is evaluated, and if it evaluates to `#f`, the expressions
(vector-copy vector start end) (vector-copy vector start end)
Returns a newly allocated copy of the elements of the given
vector between `start` and `end`. The elements of the new
vector are the same (in the sense of `eqv?`) as the elements
of the old.
# vector-copy! # vector-copy!
(vector-copy! to at from) (vector-copy! to at from)
@ -1315,6 +1417,14 @@ Semantics: The `test` is evaluated, and if it evaluates to `#f`, the expressions
(vector-copy! to at from start end) (vector-copy! to at from start end)
Copies the elements of `vector` from between `start` and `end`
to vector `to`, starting at `at`.
(define a (vector 1 2 3 4 5))
(define b (vector 10 20 30 40 50))
(vector-copy! b 1 a 0 2)
b => #(10 1 2 40 50)
# vector-fill! # vector-fill!
(vector-fill! vector fill) (vector-fill! vector fill)
@ -1323,14 +1433,20 @@ Semantics: The `test` is evaluated, and if it evaluates to `#f`, the expressions
(vector-fill! vector fill start end) (vector-fill! vector fill start end)
The `vector-fill!` procedure stores `fill` in the elements of `vector` between `start` and `end`.
# vector-for-each # vector-for-each
(vector-for-each proc vector1 vector2 ...) (vector-for-each proc vector1 vector2 ...)
`vector-for-each` is like `for-each` but the arguments consist of vectors instead of lists.
# vector-map # vector-map
(vector-map proc vector1 vector2 ...) (vector-map proc vector1 vector2 ...)
`vector-map` is like `map` but the arguments consist of vectors instead of lists.
# when # when
*Syntax* *Syntax*
@ -1349,6 +1465,8 @@ Semantics: The `test` is evaluated, and if it evaluates to a true value, the exp
(with-exception-handler handler thunk) (with-exception-handler handler thunk)
The `with-exception-handler` procedure returns the results of invoking `thunk`. `handler` is installed as the current exception handler in the dynamic environment used for the invocation of `thunk`.
# with-handler # with-handler
(with-handler handler body) (with-handler handler body)
@ -1359,13 +1477,18 @@ Semantics: The `test` is evaluated, and if it evaluates to a true value, the exp
(write-char char port) (write-char char port)
Write `char` to the current output port or `port` if specified.
# write-string # write-string
(write-string string) (write-string string)
(write-string string port) (write-string string port)
Write `string` to the current output port or `port` if specified.
# zero? # zero?
(zero? n) (zero? n)
Returns `#t` if `n` is zero and `#f` otherwise.