Added documentation

This commit is contained in:
Justin Ethier 2016-10-01 18:24:19 -04:00
parent 9bfc5cee3b
commit 4676b376ba

View file

@ -27,8 +27,6 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../r7rs.pdf)
- [`cdar `](#cdar)
- [`cddr `](#cddr)
- [`cdr `](#cdr)
- [`cell `](#cell)
- [`cell-get `](#cell-get)
- [`char->integer `](#char-integer)
- [`char? `](#char)
- [`close-input-port `](#close-input-port)
@ -64,7 +62,6 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../r7rs.pdf)
- [`real? `](#real)
- [`set-car! `](#set-car)
- [`set-cdr! `](#set-cdr)
- [`set-cell! `](#set-cell)
- [`string->number `](#string-number)
- [`string->symbol `](#string-symbol)
- [`string-append `](#string-append)
@ -83,79 +80,224 @@ For more information see the [R<sup>7</sup>RS Scheme Specification](../r7rs.pdf)
- [`vector? `](#vector)
#\*
(* z1 ...)
#+
(+ z1 ...)
#-
(- z)
(- z1 z2 ...)
#/
(/ z)
(/ z1 z2 ...)
#<
(< x1 x2 ...)
#<=
(<= x1 x2 ...)
#=
(= x1 x2 ...)
#>
(> x1 x2 ...)
#>=
(>= x1 x2 ...)
#apply
(apply proc arg1 ... args)
The `apply` procedure calls `proc` with the elements of the list `(append (list arg1 ...) args)` as the actual arguments.
#boolean?
(boolean? obj)
Determine if `obj` is a boolean.
#bytevector
(bytevector byte ...)
Create a new bytevector consisting of the given bytes.
#bytevector-append
(bytevector-append bytevector ...)
Append give bytevectors to create a new bytevector.
#bytevector-length
(bytevector-length bytevector)
Return the length of the given bytevector.
#bytevector-u8-ref
(bytevector-u8-ref bytevector k)
Return the bytevector element at index `k`.
#bytevector-u8-set!
(bytevector-u8-set! bytevector k byte)
Change the value at index `k` of the bytevector to `byte`.
#bytevector?
(bytevector? obj)
Determine if `obj` is a bytevector.
#caar
(caar pair)
Return `(car (car pair))`
#cadr
(cadr pair)
Return `(car (cdr pair))`
#car
(car pair)
Return the contents of the car field of `pair`.
#cdar
(cdar pair)
Return `(cdr (car pair))`
#cddr
(cddr pair)
Return `(cdr (cdr pair))`
#cdr
#cell
#cell-get
(cdr pair)
Return the contents of the cdr field of `pair`.
#char->integer
(char->integer char)
Return the `char` as an integer value.
#char?
(char? obj)
Determine if `obj` is a character.
#close-input-port
(close-input-port port)
Close the given input port.
#close-output-port
(close-output-port port)
Close the given output port.
#close-port
(close-port port)
Close the given port.
#command-line-arguments
(command-line-arguments)
Return the command line arguments to the program as a list of strings.
#cons
(cons a b)
Create a new pair with its car field set to `a` and its cdr field set to `b`.
#delete-file
(delete-file filename)
Delete a file with the given filename.
#eof-object?
(eof-object? obj)
Determine if the given object is an EOF object.
#eq?
(eq? a b)
Determine if `a` and `b` are equal by comparing their pointer values. This operation is guaranteed to be a single comparison no matter the type of each object passed to the function.
#equal?
(equal? a b)
Determine if `a` and `b` are equal by doing a "deep" comparison. For lists and vectors this means each element in the data structures will be compared until either the end of the structure is reached or an inequality is found. `equal?` is guaranteed to work for circular lists.
#eqv?
(eqv? a b)
An alias of `eq?`.
#error
(error message obj ...)
Raises an exception by calling `raise` with the given message and objects.
#exit
(exit)
(exit obj)
Exit the program.
#file-exists?
(file-exists? filename)
Determine if the given file exists.
#integer->char
(integer->char x)
Return a character with the same value as the given integer.
#integer?
(integer? obj)
Determine if the given object is an integer.
#length
(length list)
Returns the length of `list`.
#list->string
(list->string list)
Convert the given list of characters to a string.
#list->vector
(list->vector list)
Convert the given list to a vector.
#make-bytevector
(make-bytevector k)
(make-bytevector k byte)
Create a new bytevector of length `k`. If `byte` is provided, each element of the bytevector will be assigned this value.
#make-vector
(make-vector k)
(make-vector k obj)
Create a new vector of length `k`. If `obj` is provided, each element of the vector will be assigned this value.
#null?
(null? obj)
Determine if the given object is the empty list.
#number->string
(number->string z)
(number->string z radix)
Return a string representation of the given number.
#number?
(number? obj)
Determine if the given object is a number.
#open-input-file
(open-input-file string)
Return an input port that can deliver data from the file `string`.
#open-output-file
(open-output-file string)
Return an output port that can deliver data from the file `string`.
#pair?
(pair? obj)
Determine if `obj` is a pair.
#peek-char
(peek-char)
(peek-char port)
Returns the next character available from the input port. If no characters are available and end-of-file object is returned.
#port?
(port? obj)
Determine if `obj` is a port.
#procedure?
(procedure? obj)
Determine if `obj` is a function.
#read-char
(read-char)
(read-char port)
Read a character from the input port.
#real?
(real? obj)
Determine if `obj` is a real number.
#set-car!
(set-car! pair obj)
Set the car field of `pair` to `obj`.
#set-cdr!
#set-cell!
(set-cdr! pair obj)
Set the car field of `pair` to `obj`.
#string->number
(string->number string)
(string->number string radix)
Return the number represented by the given string.
#string->symbol
(string->symbol string)
Convert given string to a symbol.
#string-append
(string-append string ...)
Returns a new string whose characters are the concatenation of the given strings.
#string-cmp
(string-cmp string1 string2)
Compare both strings and return 0 if the strings are equal, a positive number if `string1` is "greater than" `string2`, and a negative number otherwise.
#string-length
(string-length string)
Return the length of `string`.
#string-ref
(string-ref string k)
Return the character at position `k` of `string`.
#string-set!
(string-set! string k char)
Set the character of `string` at position `k` to `char`.
#string?
(string? obj)
Determine if `obj` is a string.
#substring
(substring string start end)
Return a newly-allocatd string consisting of the characters of `string` starting from position `start` and ending at `end`.
#symbol->string
(symbol->string symbol)
Return a string based on the given symbol.
#symbol?
(symbol? obj)
Determine if `obj` is a symbol.
#system
(system string)
Execute an OS command `string` and return the resulting status as a number.
#vector-length
(vector-length vector)
Return the length of `vector`.
#vector-ref
(vector-ref vector k)
Return the element at position `k` of `vector`.
#vector-set!
(vector-set! vector k obj)
Set the element of `vector` at position `k` to `obj`.
#vector?
(vector? obj)
Determine if `obj` is a vector.