mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Sync
This commit is contained in:
parent
e30040e2d7
commit
0a7fb64741
7 changed files with 429 additions and 5 deletions
|
@ -40,7 +40,7 @@ Library Name | Description
|
||||||
|
|
||||||
Cyclone supports the following [Scheme Requests for Implementation (SRFI)](http://srfi.schemers.org/) libraries. Detailed information is available in the linked SRFI page as well as the provided Cyclone API.
|
Cyclone supports the following [Scheme Requests for Implementation (SRFI)](http://srfi.schemers.org/) libraries. Detailed information is available in the linked SRFI page as well as the provided Cyclone API.
|
||||||
|
|
||||||
Note that these libraries may be imported using either the SRFI number (EG: `(srfi 1)` or a descriptive name (EG: `(scheme list)`). These descriptive names follow the recommendations from R7RS Large where available.
|
Note that these libraries may be imported using either the SRFI number, such as `(srfi 1)`, or a descriptive name: `(scheme list)`. These descriptive names follow the recommendations from R7RS Large where available.
|
||||||
|
|
||||||
Library Name | SRFI Number | Description | External Documentation
|
Library Name | SRFI Number | Description | External Documentation
|
||||||
--------------------------------------- | ----------- | ----------- | ----------------------
|
--------------------------------------- | ----------- | ----------- | ----------------------
|
||||||
|
|
|
@ -167,6 +167,8 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../../r7rs.p
|
||||||
|
|
||||||
(abs num)
|
(abs num)
|
||||||
|
|
||||||
|
Return the absolute value of `num`.
|
||||||
|
|
||||||
# and
|
# and
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -184,24 +186,55 @@ Semantics: The `{test}` expressions are evaluated from left to right, and if any
|
||||||
|
|
||||||
(any pred lst)
|
(any pred lst)
|
||||||
|
|
||||||
|
Return `#t` if predicate function `pred` is true for any value of `lst`. Otherwise `#f` is returned.
|
||||||
|
|
||||||
# append
|
# append
|
||||||
|
|
||||||
(append list ...)
|
(append list ...)
|
||||||
|
|
||||||
|
The last argument, if there is one, can be of any type.
|
||||||
|
|
||||||
|
Returns a list consisting of the elements of the first list
|
||||||
|
followed by the elements of the other lists. If there are no
|
||||||
|
arguments, the empty list is returned. If there is exactly
|
||||||
|
one argument, it is returned. Otherwise the resulting list
|
||||||
|
is always newly allocated, except that it shares structure
|
||||||
|
with the last argument. An improper list results if the last
|
||||||
|
argument is not a proper list.
|
||||||
|
|
||||||
|
(append '(x) '(y)) => (x y)
|
||||||
|
(append '(a) '(b c d)) => (a b c d)
|
||||||
|
(append '(a (b)) '((c))) => (a (b) (c))
|
||||||
|
(append '(a b) '(c . d)) => (a b c . d)
|
||||||
|
(append '() 'a) => a
|
||||||
|
|
||||||
# assoc
|
# assoc
|
||||||
|
|
||||||
(assoc obj alist)
|
(assoc obj alist)
|
||||||
|
|
||||||
(assoc obj alist compare)
|
(assoc obj alist compare)
|
||||||
|
|
||||||
|
It is an error if alist (for "association list") is not a list of pairs.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
`assoc` uses `compare` to compare `obj` with the car fields
|
||||||
|
of the pairs in `alist` if given and `equal?` otherwise.
|
||||||
|
|
||||||
# assq
|
# assq
|
||||||
|
|
||||||
(assq obj alist)
|
(assq obj alist)
|
||||||
|
|
||||||
|
The `assq` procedure is the same as `assoc` except it uses `eq?` to compare `obj` with the car fields of the pairs in `alist`.
|
||||||
|
|
||||||
# assv
|
# assv
|
||||||
|
|
||||||
(assv obj alist)
|
(assv obj alist)
|
||||||
|
|
||||||
|
The `assv` procedure is the same as `assoc` except it uses `eqv?` to compare `obj` with the car fields of the pairs in `alist`.
|
||||||
|
|
||||||
# begin
|
# begin
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -229,6 +262,8 @@ This form of `begin` can be used as an ordinary expression. The `{expression}`'
|
||||||
|
|
||||||
(boolean=? b1 b2 ...)
|
(boolean=? b1 b2 ...)
|
||||||
|
|
||||||
|
Returns `#t` if all the arguments are booleans and all are `#t` or all are `#f`.
|
||||||
|
|
||||||
# bytevector-copy
|
# bytevector-copy
|
||||||
|
|
||||||
(bytevector-copy bytevector)
|
(bytevector-copy bytevector)
|
||||||
|
@ -237,6 +272,11 @@ This form of `begin` can be used as an ordinary expression. The `{expression}`'
|
||||||
|
|
||||||
(bytevector-copy bytevector start end)
|
(bytevector-copy bytevector start end)
|
||||||
|
|
||||||
|
Returns a newly allocated bytevector containing the bytes in `bytevector` between `start` and `end`.
|
||||||
|
|
||||||
|
(define a #u8(1 2 3 4 5))
|
||||||
|
(bytevector-copy a 2 4)) => #u8(3 4)
|
||||||
|
|
||||||
# bytevector-copy!
|
# bytevector-copy!
|
||||||
|
|
||||||
(bytevector-copy! to at from)
|
(bytevector-copy! to at from)
|
||||||
|
@ -245,6 +285,13 @@ This form of `begin` can be used as an ordinary expression. The `{expression}`'
|
||||||
|
|
||||||
(bytevector-copy! to at from start end)
|
(bytevector-copy! to at from start end)
|
||||||
|
|
||||||
|
Copies the bytes of `bytevector` from between `start` and `end` to bytevector `to`, starting at `at`.
|
||||||
|
|
||||||
|
(define a (bytevector 1 2 3 4 5))
|
||||||
|
(define b (bytevector 10 20 30 40 50))
|
||||||
|
(bytevector-copy! b 1 a 0 2)
|
||||||
|
b => #u8(10 1 2 40 50)
|
||||||
|
|
||||||
# call-with-current-continuation
|
# call-with-current-continuation
|
||||||
|
|
||||||
(call-with-current-continuation proc)
|
(call-with-current-continuation proc)
|
||||||
|
@ -253,14 +300,31 @@ This form of `begin` can be used as an ordinary expression. The `{expression}`'
|
||||||
|
|
||||||
(call-with-port port proc)
|
(call-with-port port proc)
|
||||||
|
|
||||||
|
It is an error if `proc` does not accept one argument.
|
||||||
|
|
||||||
|
The `call-with-port` procedure calls `proc` with `port` as an argument. If `proc` returns, then the `port` is closed automatically and the values yielded by the `proc` are returned.
|
||||||
|
|
||||||
# call-with-values
|
# call-with-values
|
||||||
|
|
||||||
(call-with-values producer consumer)
|
(call-with-values producer consumer)
|
||||||
|
|
||||||
|
Calls its `producer` argument with no arguments 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`.
|
||||||
|
|
||||||
|
(call-with-values (lambda () (values 4 5))
|
||||||
|
(lambda (a b) b))
|
||||||
|
=> 5
|
||||||
|
(call-with-values * -) => -1
|
||||||
|
|
||||||
# call/cc
|
# call/cc
|
||||||
|
|
||||||
(call/cc proc)
|
(call/cc proc)
|
||||||
|
|
||||||
|
An abbreviation for `call-with-current-continuation`.
|
||||||
|
|
||||||
# case
|
# case
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -304,30 +368,44 @@ If the selected `{clause}` or else clause uses the `=>` alternate form, then the
|
||||||
|
|
||||||
(ceiling z)
|
(ceiling z)
|
||||||
|
|
||||||
|
Returns the smallest integer not smaller than `z`.
|
||||||
|
|
||||||
# char<=?
|
# char<=?
|
||||||
|
|
||||||
(char<=? c1 c2 c3 ...)
|
(char<=? c1 c2 c3 ...)
|
||||||
|
|
||||||
|
Return `#t` if the results of passing the arguments to `char->integer` are monotonically increasing or equal.
|
||||||
|
|
||||||
# char<?
|
# char<?
|
||||||
|
|
||||||
(char<? c1 c2 c3 ...)
|
(char<? c1 c2 c3 ...)
|
||||||
|
|
||||||
|
Return `#t` if the results of passing the arguments to `char->integer` are respectively equal, monotonically increasing.
|
||||||
|
|
||||||
# char=?
|
# char=?
|
||||||
|
|
||||||
(char=? c1 c2 c3 ...)
|
(char=? c1 c2 c3 ...)
|
||||||
|
|
||||||
|
Return `#t` if the results of passing the arguments to `char->integer` are equal.
|
||||||
|
|
||||||
# char>=?
|
# char>=?
|
||||||
|
|
||||||
(char>=? c1 c2 c3 ...)
|
(char>=? c1 c2 c3 ...)
|
||||||
|
|
||||||
|
Return `#t` if the results of passing the arguments to `char->integer` are monotonically decreasing or equal.
|
||||||
|
|
||||||
# char>?
|
# char>?
|
||||||
|
|
||||||
(char>? c1 c2 c3 ...)
|
(char>? c1 c2 c3 ...)
|
||||||
|
|
||||||
|
Return `#t` if the results of passing the arguments to `char->integer` are monotonically decreasing.
|
||||||
|
|
||||||
# complex?
|
# complex?
|
||||||
|
|
||||||
(complex? obj)
|
(complex? obj)
|
||||||
|
|
||||||
|
Return `#t` if `obj` is a complex number, `#f` otherwise.
|
||||||
|
|
||||||
# cond
|
# cond
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -409,14 +487,20 @@ A `cond-expand` is then expanded by evaluating the `{feature requirement}`'s of
|
||||||
|
|
||||||
(current-error-port)
|
(current-error-port)
|
||||||
|
|
||||||
|
Returns the current error port (an output port).
|
||||||
|
|
||||||
# current-input-port
|
# current-input-port
|
||||||
|
|
||||||
(current-input-port)
|
(current-input-port)
|
||||||
|
|
||||||
|
Return the current input port.
|
||||||
|
|
||||||
# current-output-port
|
# current-output-port
|
||||||
|
|
||||||
(current-output-port)
|
(current-output-port)
|
||||||
|
|
||||||
|
Return the current output port.
|
||||||
|
|
||||||
# define-record-type
|
# define-record-type
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -425,10 +509,20 @@ A `cond-expand` is then expanded by evaluating the `{feature requirement}`'s of
|
||||||
|
|
||||||
{constructor} {pred} {field} ...)
|
{constructor} {pred} {field} ...)
|
||||||
|
|
||||||
|
Create a new record type.
|
||||||
|
|
||||||
|
Record-type definitions are used to introduce new data
|
||||||
|
types, called record types. Like other definitions, they can
|
||||||
|
appear either at the outermost level or in a body. The values of a record type are called records and are aggregations
|
||||||
|
of zero or more fields, each of which holds a single location. A predicate, a constructor, and field accessors and
|
||||||
|
mutators are defined for each record type.
|
||||||
|
|
||||||
# denominator
|
# denominator
|
||||||
|
|
||||||
(denominator n)
|
(denominator n)
|
||||||
|
|
||||||
|
Return the denominator of `n`.
|
||||||
|
|
||||||
# do
|
# do
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -445,34 +539,52 @@ A `cond-expand` is then expanded by evaluating the `{feature requirement}`'s of
|
||||||
|
|
||||||
(dynamic-wind before thunk after)
|
(dynamic-wind before thunk after)
|
||||||
|
|
||||||
|
Calls `thunk` without arguments, returning the result(s) of this call.
|
||||||
|
|
||||||
|
`before` is called whenever execution enters the dynamic extent of the call to `thunk` and `after` is called whenever it exits that dynamic extent.
|
||||||
|
|
||||||
# eof-object
|
# eof-object
|
||||||
|
|
||||||
(eof-object)
|
(eof-object)
|
||||||
|
|
||||||
|
Return the end of file (EOF) object.
|
||||||
|
|
||||||
# error
|
# error
|
||||||
|
|
||||||
(error message obj ...)
|
(error message obj ...)
|
||||||
|
|
||||||
|
Raise an error with message `message` and one or more associated objects `obj`.
|
||||||
|
|
||||||
# even?
|
# even?
|
||||||
|
|
||||||
(even? num)
|
(even? num)
|
||||||
|
|
||||||
|
Return `#t` if `num` is even and `#f` if it is not. It is an error if `num` is not a number.
|
||||||
|
|
||||||
# every
|
# every
|
||||||
|
|
||||||
(every pred lst)
|
(every pred lst)
|
||||||
|
|
||||||
|
Return `#t` if predicate function `pred` is true for every value of `lst`. Otherwise `#f` is returned.
|
||||||
|
|
||||||
# exact
|
# exact
|
||||||
|
|
||||||
(exact? num)
|
(exact num)
|
||||||
|
|
||||||
|
Return an exact representation of number `num`.
|
||||||
|
|
||||||
# exact-integer?
|
# exact-integer?
|
||||||
|
|
||||||
(exact-integer? num)
|
(exact-integer? num)
|
||||||
|
|
||||||
|
Returns `#t` if `num` is both exact and an integer; otherwise returns `#f`.
|
||||||
|
|
||||||
# exact?
|
# exact?
|
||||||
|
|
||||||
(exact? num)
|
(exact? num)
|
||||||
|
|
||||||
|
Return `#t` if `num` is exact.
|
||||||
|
|
||||||
# expt
|
# expt
|
||||||
|
|
||||||
(expt z1 z2)
|
(expt z1 z2)
|
||||||
|
@ -481,32 +593,48 @@ A `cond-expand` is then expanded by evaluating the `{feature requirement}`'s of
|
||||||
|
|
||||||
(features)
|
(features)
|
||||||
|
|
||||||
|
Return a list of feature identifiers which `cond-expand` treats as true.
|
||||||
|
|
||||||
# floor
|
# floor
|
||||||
|
|
||||||
(floor z)
|
(floor z)
|
||||||
|
|
||||||
|
Return an integer not larger than `z`.
|
||||||
|
|
||||||
# floor-quotient
|
# floor-quotient
|
||||||
|
|
||||||
(floor-quotient n m)
|
(floor-quotient n m)
|
||||||
|
|
||||||
|
Returns the integer quotient of dividing `n` by `m`.
|
||||||
|
|
||||||
# floor-remainder
|
# floor-remainder
|
||||||
|
|
||||||
(floor-remainder n m)
|
(floor-remainder n m)
|
||||||
|
|
||||||
|
Returns the integer remainder of dividing `n` by `m`.
|
||||||
|
|
||||||
# floor/
|
# floor/
|
||||||
|
|
||||||
(floor/ n m)
|
(floor/ n m)
|
||||||
|
|
||||||
|
Return integer quotient and remainder of dividing `n` by `m`.
|
||||||
|
|
||||||
# flush-output-port
|
# flush-output-port
|
||||||
|
|
||||||
(flush-output-port)
|
(flush-output-port)
|
||||||
|
|
||||||
(flush-output-port port)
|
(flush-output-port port)
|
||||||
|
|
||||||
|
Flushes any buffered output from the buffer of `output-port`
|
||||||
|
to the underlying file or device and returns an unspecified
|
||||||
|
value.
|
||||||
|
|
||||||
# foldl
|
# foldl
|
||||||
|
|
||||||
(foldl func accum lst)
|
(foldl func accum lst)
|
||||||
|
|
||||||
|
Perform a left fold.
|
||||||
|
|
||||||
# foldr
|
# foldr
|
||||||
|
|
||||||
(foldr func end lst)
|
(foldr func end lst)
|
||||||
|
@ -515,18 +643,52 @@ A `cond-expand` is then expanded by evaluating the `{feature requirement}`'s of
|
||||||
|
|
||||||
(for-each proc list1 list2 ...)
|
(for-each proc list1 list2 ...)
|
||||||
|
|
||||||
|
It is an error if `proc` does not accept as many arguments as there are lists.
|
||||||
|
|
||||||
|
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. If more than one list is given and not all
|
||||||
|
lists have the same length, for-each terminates when the
|
||||||
|
shortest list runs out. The lists can be circular, but it is
|
||||||
|
an error if all of them are circular.
|
||||||
|
|
||||||
|
(let ((v (make-vector 5)))
|
||||||
|
(for-each (lambda (i)
|
||||||
|
(vector-set! v i (* i i)))
|
||||||
|
’(0 1 2 3 4))
|
||||||
|
v) => #(0 1 4 9 16)
|
||||||
|
|
||||||
# gcd
|
# gcd
|
||||||
|
|
||||||
(gcd n1 ...)
|
(gcd n1 ...)
|
||||||
|
|
||||||
|
Return the greatest commong divisor of the arguments.
|
||||||
|
|
||||||
# get-output-bytevector
|
# get-output-bytevector
|
||||||
|
|
||||||
(get-output-bytevector port)
|
(get-output-bytevector port)
|
||||||
|
|
||||||
|
Returns a bytevector consisting of the bytes that have been output to the `port` so far in the order they were output.
|
||||||
|
|
||||||
# get-output-string
|
# get-output-string
|
||||||
|
|
||||||
(get-output-string port)
|
(get-output-string port)
|
||||||
|
|
||||||
|
Returns a string consisting of the characters that have been output to the `port` so far in the order they were output. If the result string is modified, the effect is unspecified.
|
||||||
|
|
||||||
|
(parameterize
|
||||||
|
((current-output-port
|
||||||
|
(open-output-string)))
|
||||||
|
(display "piece")
|
||||||
|
(display " by piece ")
|
||||||
|
(display "by piece.")
|
||||||
|
(newline)
|
||||||
|
(get-output-string (current-output-port)))
|
||||||
|
|
||||||
|
=> "piece by piece by piece.\n"
|
||||||
|
|
||||||
# guard
|
# guard
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -541,22 +703,32 @@ A `cond-expand` is then expanded by evaluating the `{feature requirement}`'s of
|
||||||
|
|
||||||
(inexact z)
|
(inexact z)
|
||||||
|
|
||||||
|
Return `z` as an inexact number.
|
||||||
|
|
||||||
# inexact?
|
# inexact?
|
||||||
|
|
||||||
(inexact? num)
|
(inexact? num)
|
||||||
|
|
||||||
|
Return `#t` if `num` is inexact and `#f` otherwise.
|
||||||
|
|
||||||
# input-port-open?
|
# input-port-open?
|
||||||
|
|
||||||
(input-port-open? port)
|
(input-port-open? port)
|
||||||
|
|
||||||
|
Return `#t` if the given input port is open and `#f` otherwise.
|
||||||
|
|
||||||
# input-port?
|
# input-port?
|
||||||
|
|
||||||
(input-port? port)
|
(input-port? port)
|
||||||
|
|
||||||
|
Return `#t` if `port` is an input port and `#f` otherwise.
|
||||||
|
|
||||||
# lcm
|
# lcm
|
||||||
|
|
||||||
(lcm n1 ...)
|
(lcm n1 ...)
|
||||||
|
|
||||||
|
Return the least common multiple of the arguments.
|
||||||
|
|
||||||
# let
|
# let
|
||||||
|
|
||||||
*Syntax*
|
*Syntax*
|
||||||
|
@ -683,26 +855,54 @@ If it is not possible to evaluate each `{init}` without assigning or referring t
|
||||||
|
|
||||||
(list obj ...)
|
(list obj ...)
|
||||||
|
|
||||||
|
Return a newly allocated list of its arguments.
|
||||||
|
|
||||||
# list-copy
|
# list-copy
|
||||||
|
|
||||||
(list-copy lst)
|
(list-copy lst)
|
||||||
|
|
||||||
|
Returns a newly allocated copy of the given `obj` if it is a
|
||||||
|
list. Only the pairs themselves are copied; the cars of the
|
||||||
|
result are the same (in the sense of `eqv?`) as the cars of list.
|
||||||
|
|
||||||
|
If `obj` is an improper list, so is the result, and the final cdrs
|
||||||
|
are the same in the sense of `eqv?`. An obj which is not a
|
||||||
|
list is returned unchanged.
|
||||||
|
|
||||||
|
It is an error if obj is a circular list.
|
||||||
|
|
||||||
|
(define a ’(1 8 2 8)) ; a may be immutable
|
||||||
|
(define b (list-copy a))
|
||||||
|
(set-car! b 3) ; b is mutable
|
||||||
|
|
||||||
|
b => (3 8 2 8)
|
||||||
|
a => (1 8 2 8)
|
||||||
|
|
||||||
|
|
||||||
# list-ref
|
# list-ref
|
||||||
|
|
||||||
(list-ref lst k)
|
(list-ref lst k)
|
||||||
|
|
||||||
|
Returns the kth element of `lst`.
|
||||||
|
|
||||||
# list-set!
|
# list-set!
|
||||||
|
|
||||||
(list-set! lst k obj)
|
(list-set! lst k obj)
|
||||||
|
|
||||||
|
Stores `obj` in element `k` of `lst`.
|
||||||
|
|
||||||
# list-tail
|
# list-tail
|
||||||
|
|
||||||
(list-tail lst k)
|
(list-tail lst k)
|
||||||
|
|
||||||
|
Returns the sublist of `lst` obtained by omitting the first `k` elements.
|
||||||
|
|
||||||
# list?
|
# list?
|
||||||
|
|
||||||
(list? o)
|
(list? o)
|
||||||
|
|
||||||
|
Returns `#t` if the given object is a list, and `#f` otherwise.
|
||||||
|
|
||||||
# make-constructor
|
# make-constructor
|
||||||
|
|
||||||
(make-constructor make name)
|
(make-constructor make name)
|
||||||
|
@ -717,12 +917,18 @@ If it is not possible to evaluate each `{init}` without assigning or referring t
|
||||||
|
|
||||||
(make-list k fill)
|
(make-list k fill)
|
||||||
|
|
||||||
|
Returns a newly allocated list 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.
|
||||||
|
|
||||||
# make-parameter
|
# make-parameter
|
||||||
|
|
||||||
(make-parameter init)
|
(make-parameter init)
|
||||||
|
|
||||||
(make-parameter init converter)
|
(make-parameter init converter)
|
||||||
|
|
||||||
|
Returns a newly allocated parameter object, which is a procedure that accepts zero arguments and returns the value associated with the parameter object.
|
||||||
|
|
||||||
# make-setter
|
# make-setter
|
||||||
|
|
||||||
(make-setter sym name idx)
|
(make-setter sym name idx)
|
||||||
|
@ -733,6 +939,11 @@ If it is not possible to evaluate each `{init}` without assigning or referring t
|
||||||
|
|
||||||
(make-string k fill)
|
(make-string k fill)
|
||||||
|
|
||||||
|
The `make-string` procedure returns a newly allocated
|
||||||
|
string of length `k`. If `fill` char is given, then all the characters
|
||||||
|
of the string are initialized to `fill` , otherwise the contents
|
||||||
|
of the string are unspecified.
|
||||||
|
|
||||||
# make-type-predicate
|
# make-type-predicate
|
||||||
|
|
||||||
(make-type-predicate pred name)
|
(make-type-predicate pred name)
|
||||||
|
@ -741,70 +952,119 @@ If it is not possible to evaluate each `{init}` without assigning or referring t
|
||||||
|
|
||||||
(map proc list1 list2 ...)
|
(map proc list1 list2 ...)
|
||||||
|
|
||||||
|
The `map` procedure applies `proc` element-wise to the elements of the lists and returns a list of the results, in order.
|
||||||
|
|
||||||
|
If more than one list is given and not all lists have the same length, `map` terminates when the shortest list runs out. The lists can be circular, but it is an error if all of them are circular. It is an error for `proc` to mutate any of the lists. The dynamic order in which `proc` is applied to the elements of the lists is unspecified. If multiple returns occur from `map`, the values returned by earlier returns are not mutated.
|
||||||
|
|
||||||
|
(map cadr ’((a b) (d e) (g h)))
|
||||||
|
=> (b e h)
|
||||||
|
|
||||||
|
(map (lambda (n) (expt n n))
|
||||||
|
’(1 2 3 4 5))
|
||||||
|
=> (1 4 27 256 3125)
|
||||||
|
|
||||||
|
(map + ’(1 2 3) ’(4 5 6 7)) => (5 7 9)
|
||||||
|
|
||||||
# max
|
# max
|
||||||
|
|
||||||
(max x1 x2 ...)
|
(max x1 x2 ...)
|
||||||
|
|
||||||
|
`max` returns the largest of its arguments.
|
||||||
|
|
||||||
# member
|
# member
|
||||||
|
|
||||||
(member obj lst)
|
(member obj lst)
|
||||||
|
|
||||||
(member obj lst compare)
|
(member obj lst compare)
|
||||||
|
|
||||||
|
Returns the first sublist of `lst` whose car is `obj`, where the sublists are the non-empty lists returned by `(list-tail lst k)` for `k` less than the length of `lst`.
|
||||||
|
|
||||||
|
If obj does not occur in list, then #f (not the empty
|
||||||
|
list) is returned.
|
||||||
|
|
||||||
|
`member` uses compare to compare elements of the list, if given, and `equal?` otherwise.
|
||||||
|
|
||||||
# memq
|
# memq
|
||||||
|
|
||||||
(memq obj lst)
|
(memq obj lst)
|
||||||
|
|
||||||
|
The `memq` procedure is the same as `member` but uses `eq?` to compare `obj` with the elements of `lst`.
|
||||||
|
|
||||||
# memv
|
# memv
|
||||||
|
|
||||||
(memv obj lst)
|
(memv obj lst)
|
||||||
|
|
||||||
|
The `memv` procedure is the same as `member` but uses `eqv?` to compare `obj` with the elements of `lst`.
|
||||||
|
|
||||||
# min
|
# min
|
||||||
|
|
||||||
(min x1 x2 ...)
|
(min x1 x2 ...)
|
||||||
|
|
||||||
|
`min` returns the smallest of its arguments.
|
||||||
|
|
||||||
# modulo
|
# modulo
|
||||||
|
|
||||||
(modulo a b)
|
(modulo a b)
|
||||||
|
|
||||||
|
Return the integer remainder after dividing `a` by `b`.
|
||||||
|
|
||||||
# negative?
|
# negative?
|
||||||
|
|
||||||
(negative? n)
|
(negative? n)
|
||||||
|
|
||||||
|
Returns `#t` if `n` is a negative number and `#f` otherwise. It is an error if `n` is not a number.
|
||||||
|
|
||||||
# newline
|
# newline
|
||||||
|
|
||||||
(newline)
|
(newline)
|
||||||
|
|
||||||
(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*
|
||||||
|
@ -823,10 +1083,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*
|
||||||
|
@ -839,6 +1103,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*
|
||||||
|
@ -849,30 +1115,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*
|
||||||
|
@ -883,18 +1171,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)
|
||||||
|
@ -903,10 +1199,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)
|
||||||
|
@ -915,6 +1215,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)
|
||||||
|
@ -923,6 +1225,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)
|
||||||
|
@ -931,6 +1235,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)
|
||||||
|
@ -939,6 +1245,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)
|
||||||
|
@ -947,6 +1255,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)
|
||||||
|
@ -955,14 +1271,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)
|
||||||
|
@ -975,6 +1297,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)
|
||||||
|
@ -987,6 +1311,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*
|
||||||
|
@ -1035,14 +1361,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)
|
||||||
|
@ -1051,6 +1383,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)
|
||||||
|
@ -1059,10 +1393,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)
|
||||||
|
@ -1071,6 +1409,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)
|
||||||
|
@ -1079,6 +1422,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)
|
||||||
|
@ -1087,14 +1438,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*
|
||||||
|
@ -1113,9 +1470,17 @@ 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)
|
*Syntax*
|
||||||
|
|
||||||
|
(with-handler handler expression1 expression2 ...)
|
||||||
|
|
||||||
|
`with-handler` provides a convenient exception handling syntax.
|
||||||
|
|
||||||
|
The expressions are executed in order and if no exceptions are raised the result of the last expression is returned. Otherwise if an exception is raised then `handler` is called and its results are returned.
|
||||||
|
|
||||||
# write-char
|
# write-char
|
||||||
|
|
||||||
|
@ -1123,13 +1488,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.
|
||||||
|
|
|
@ -36,30 +36,44 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../../r7rs.p
|
||||||
|
|
||||||
(char-alphabetic? c)
|
(char-alphabetic? c)
|
||||||
|
|
||||||
|
Return `#t` if `c` is alphabetic and `#f` otherwise.
|
||||||
|
|
||||||
# char-ci<=?
|
# char-ci<=?
|
||||||
|
|
||||||
(char-ci<=? c1 c2 . cs)
|
(char-ci<=? c1 c2 . cs)
|
||||||
|
|
||||||
|
Return `#t` if the results of converting all characters to the same case and passing the arguments to `char->integer` are monotonically increasing or equal.
|
||||||
|
|
||||||
# char-ci<?
|
# char-ci<?
|
||||||
|
|
||||||
(char-ci<? c1 c2 . cs)
|
(char-ci<? c1 c2 . cs)
|
||||||
|
|
||||||
|
Return `#t` if the results of converting all characters to the same case and passing the arguments to `char->integer` are respectively equal, monotonically increasing.
|
||||||
|
|
||||||
# char-ci=?
|
# char-ci=?
|
||||||
|
|
||||||
(char-ci=? c1 c2 . cs)
|
(char-ci=? c1 c2 . cs)
|
||||||
|
|
||||||
|
Return `#t` if the results of converting all characters to the same case and passing the arguments to `char->integer` are equal.
|
||||||
|
|
||||||
# char-ci>=?
|
# char-ci>=?
|
||||||
|
|
||||||
(char-ci>=? c1 c2 . cs)
|
(char-ci>=? c1 c2 . cs)
|
||||||
|
|
||||||
|
Return `#t` if the results of converting all characters to the same case and passing the arguments to `char->integer` are monotonically decreasing or equal.
|
||||||
|
|
||||||
# char-ci>?
|
# char-ci>?
|
||||||
|
|
||||||
(char-ci>? c1 c2 . cs)
|
(char-ci>? c1 c2 . cs)
|
||||||
|
|
||||||
|
Return `#t` if the results of converting all characters to the same case and passing the arguments to `char->integer` are monotonically decreasing.
|
||||||
|
|
||||||
# char-downcase
|
# char-downcase
|
||||||
|
|
||||||
(char-downcase c)
|
(char-downcase c)
|
||||||
|
|
||||||
|
Returns the lowercase equivalent of `c` if one exists, otherwise `c` is returned.
|
||||||
|
|
||||||
# char-foldcase
|
# char-foldcase
|
||||||
|
|
||||||
(char-foldcase c)
|
(char-foldcase c)
|
||||||
|
@ -68,26 +82,38 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../../r7rs.p
|
||||||
|
|
||||||
(char-lower-case? c)
|
(char-lower-case? c)
|
||||||
|
|
||||||
|
Return `#t` if `c` is lower case and `#f` otherwise.
|
||||||
|
|
||||||
# char-numeric?
|
# char-numeric?
|
||||||
|
|
||||||
(char-numeric? c)
|
(char-numeric? c)
|
||||||
|
|
||||||
|
Return `#t` if `c` is numeric and `#f` otherwise.
|
||||||
|
|
||||||
# char-upcase
|
# char-upcase
|
||||||
|
|
||||||
(char-upcase c)
|
(char-upcase c)
|
||||||
|
|
||||||
|
Returns the uppercase equivalent of `c` if one exists, otherwise `c` is returned.
|
||||||
|
|
||||||
# char-upper-case?
|
# char-upper-case?
|
||||||
|
|
||||||
(char-upper-case? c)
|
(char-upper-case? c)
|
||||||
|
|
||||||
|
Return `#t` if `c` is alphabetic and `#f` otherwise.
|
||||||
|
|
||||||
# char-whitespace?
|
# char-whitespace?
|
||||||
|
|
||||||
(char-whitespace? c)
|
(char-whitespace? c)
|
||||||
|
|
||||||
|
Return `#t` if `c` is whitespace and `#f` otherwise.
|
||||||
|
|
||||||
# digit-value
|
# digit-value
|
||||||
|
|
||||||
(digit-value c)
|
(digit-value c)
|
||||||
|
|
||||||
|
This procedure returns the numeric value (0 to 9) of its argument if it is a numeric digit (that is, if `char-numeric?` returns `#t`), or `#f` on any other character.
|
||||||
|
|
||||||
# string-ci<=?
|
# string-ci<=?
|
||||||
|
|
||||||
(string-ci<=? s1 s2)
|
(string-ci<=? s1 s2)
|
||||||
|
@ -100,6 +126,8 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../../r7rs.p
|
||||||
|
|
||||||
(string-ci=? s1 s2)
|
(string-ci=? s1 s2)
|
||||||
|
|
||||||
|
Returns `#t` if all of the given strings are equal using a case-insensitive comparison, and false otherwise.
|
||||||
|
|
||||||
# string-ci>=?
|
# string-ci>=?
|
||||||
|
|
||||||
(string-ci>=? s1 s2)
|
(string-ci>=? s1 s2)
|
||||||
|
@ -112,6 +140,8 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../../r7rs.p
|
||||||
|
|
||||||
(string-downcase str)
|
(string-downcase str)
|
||||||
|
|
||||||
|
Return a newly-allocated string with any uppercase characters converted to lowercase.
|
||||||
|
|
||||||
# string-foldcase
|
# string-foldcase
|
||||||
|
|
||||||
(string-foldcase str)
|
(string-foldcase str)
|
||||||
|
@ -120,3 +150,5 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../../r7rs.p
|
||||||
|
|
||||||
(string-upcase str)
|
(string-upcase str)
|
||||||
|
|
||||||
|
Return a newly-allocated string with any lowercase characters converted to uppercase.
|
||||||
|
|
||||||
|
|
|
@ -24,19 +24,26 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../../r7rs.p
|
||||||
|
|
||||||
(imag-part x)
|
(imag-part x)
|
||||||
|
|
||||||
|
Return the imaginary part of complex number `x`.
|
||||||
|
|
||||||
# magnitude
|
# magnitude
|
||||||
|
|
||||||
(magnitude z)
|
(magnitude z)
|
||||||
|
|
||||||
# make-polar
|
# make-polar
|
||||||
|
|
||||||
(make-polar x y)
|
(make-polar r phi)
|
||||||
|
|
||||||
|
Return a complex number corresponding to the given polar coordinate.
|
||||||
|
|
||||||
# make-rectangular
|
# make-rectangular
|
||||||
|
|
||||||
(make-rectangular x y)
|
(make-rectangular x y)
|
||||||
|
|
||||||
|
Create a complex number with real component `x` and imaginary component `y`.
|
||||||
|
|
||||||
# real-part
|
# real-part
|
||||||
|
|
||||||
(real-part x)
|
(real-part x)
|
||||||
|
|
||||||
|
Return the real part of complex number `x`.
|
||||||
|
|
|
@ -13,6 +13,11 @@ layout: main
|
||||||
title: API
|
title: API
|
||||||
---
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
layout: main
|
||||||
|
title: API
|
||||||
|
---
|
||||||
|
|
||||||
# Match Library
|
# Match Library
|
||||||
|
|
||||||
The `(scheme cyclone match)` library provides a hygienic pattern matcher, based on Alex Shinn's portable `match.scm`.
|
The `(scheme cyclone match)` library provides a hygienic pattern matcher, based on Alex Shinn's portable `match.scm`.
|
||||||
|
|
|
@ -13,6 +13,11 @@ layout: main
|
||||||
title: API
|
title: API
|
||||||
---
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
layout: main
|
||||||
|
title: API
|
||||||
|
---
|
||||||
|
|
||||||
# Test Library
|
# Test Library
|
||||||
|
|
||||||
The `(scheme cyclone test)` library contains a testing framework ported from `(chibi test)` which in turn was ported from CHICKEN.
|
The `(scheme cyclone test)` library contains a testing framework ported from `(chibi test)` which in turn was ported from CHICKEN.
|
||||||
|
|
|
@ -34,7 +34,12 @@ Write object to the given output port, or the current output if none is given. O
|
||||||
(write-shared obj)
|
(write-shared obj)
|
||||||
(write-shared obj port)
|
(write-shared obj port)
|
||||||
|
|
||||||
|
`write-shared` is the same as `write` because Cyclone does not support datum labels at this time.
|
||||||
|
|
||||||
# write-simple
|
# write-simple
|
||||||
|
|
||||||
(write-simple obj)
|
(write-simple obj)
|
||||||
(write-simple obj port)
|
(write-simple obj port)
|
||||||
|
|
||||||
|
`write-simple` is the same as `write` because Cyclone does not support datum labels at this time.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue