Catalog of Language Elements # - C
Catalog of Language Elements D - L
Catalog of Language Elements M - R
Category | UI event | ||
Format | (scl-enter id) | ||
Parameters |
|
||
Description | scl-enter is the event posted when the user has tapped a scrollbar but not yet lifted the pen. |
Category | UI event | ||||
Format | (scl-exit id new) | ||||
Parameters |
|
||||
Description | scl-exit is posted when the user has finished moving a scrollbar. |
Category | Primitive procedure | |||
Format | (scl-get-val id) | |||
Parameters |
|
|||
Description | scl-get-val returns the values of the scrollbar with
id id as a list of 4 integers:
Have a look at the sample program showing the interaction between fields and scrollbars. |
|||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | UI event | ||||||
Format | (scl-repeat id new old) | ||||||
Parameters |
|
||||||
Description | scl-repeat is posted continuously while the user is moving a scrollbar. You should return #f from your handler to make it work properly. |
Category | Primitive procedure | ||||
Format | (scl-set-val id vals) | ||||
Parameters |
|
||||
Description | scl-set-val sets the values of the scrollbar with
id id. vals must be a list of
4 integers indicating:
|
The return value is vals.||||
R4RS Compliance | LispMe extension | ||||
Examples |
|
Category | Special form | ||||||
Format | (set! var expr) | ||||||
Parameters |
|
||||||
Description | set! evaluates expr and assigns the
value to var. var must be
bound (by
define,
lambda,
let, or
letrec),
or an error results. Though R4RS doesn't specify a return value for set!, in LispMe the assigned value is returned. |
||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | ||||
Format | (set-car! pair obj) | ||||
Parameters |
|
||||
Description | set-car! changes the car component of pair to obj and returns the modified pair. | ||||
R4RS Compliance | Full | ||||
Examples |
|
Category | Primitive procedure | ||||
Format | (set-cdr! pair obj) | ||||
Parameters |
|
||||
Description | set-cdr! changes the cdr component of pair to obj and returns the modified pair. | ||||
R4RS Compliance | Full | ||||
Examples |
|
Category | Primitive procedure | ||||||||
Format | (set-palette index r g b) | ||||||||
Parameters |
|
||||||||
Description | set-palette modifies the current colortable
(palette) by setting the entry index to the
given r g b values. Though according to the
SDK, only indexes from 231 to 254 should be used for user-defined
colors, you can modify any index using this procedure.
The value returned is index. On systems running older OS versions than 3.5, this procedure does nothing. |
||||||||
R4RS Compliance | LispMe extension | ||||||||
Examples |
|
Category | Primitive procedure | |||
Format | (set-resdb str) | |||
Parameters |
|
|||
Description | set-resdb sets the name of the resource database being used in future calls to user interface functions. Only one resource DB can be active at any time, if another DB is already open, it'll be closed. Note, that the DB name is case-sensitive. The parameter #f closes the current resource DB. The return value is str. | |||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (sin z) | |||||||||
Parameters |
|
|||||||||
Description | sin computes the sine of the number z.
z is an angle measured in radians.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (sinh z) | |||||||||
Parameters |
|
|||||||||
Description | sinh computes the hyperbolic sine of the number
z.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | LispMe extension | |||||||||
Examples |
|
Category | Primitive procedure | ||||
Format | (sound freq time) | ||||
Parameters |
|
||||
Description | sound plays a sound of frequency freq
(measured in Hertz) for time milliseconds.
time and freqmust be positive or an
error results. Frequencies below 128 seem to be wrongly reproduced by the Pilot, so they're not allowed. |
||||
R4RS Compliance | LispMe extension | ||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (sqrt z) | |||||||||
Parameters |
|
|||||||||
Description | sqrt returns the square root of a number z. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (string->list string) | |||||||||
Parameters |
|
|||||||||
Description | string->list returns a newly allocated list of the characters in string. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (string->object string) | ||||||||||||
Parameters |
|
||||||||||||
Description | string->object uses the standard LispMe parser to create an object from its textual representation string, so all kind of syntax errors are possible. The type of the object is solely determined by the contents of string. string must not be larger than 4096 characters. | ||||||||||||
R4RS Compliance | LispMe extension. string->object subsumes R4RS procedures string->symbol and string->number. | ||||||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (string-append stringi ...) | |||||||||
Parameters |
|
|||||||||
Description | string-append returns a newly allocated string, which is the concatenation of all the stringi in the order written. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (string-length string) | |||||||||
Parameters |
|
|||||||||
Description | string-length returns the number of characters in string. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (string-ref string index) | ||||||
Parameters |
|
||||||
Description | string-ref returns the indexth character of string. The index of the first character is 0, and the index of the last character is the length of string minus one. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (string-set! string index char) | ||||||
Parameters |
|
||||||
Description | string-set! replaces the indexth character of string by char. The modified string is returned. The index of the first character is 0, and the index of the last character is the length of string minus one. It's no error to modify a constant string in LispMe, as all values are heap-allocated and strings are never shared, so the examples are valid. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (string=? string1 string2) | |||||||||
Parameters |
|
|||||||||
Description | string=? returns #t, if both strings consist of the same characters at corresponding index positions and both strings have the same length. Otherwise #f is returned. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (string? obj) | |||||||||
Parameters |
|
|||||||||
Description | string? returns #t for a string and #f for any other object. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (substring string start end) | ||||||||||||
Parameters |
|
||||||||||||
Description | substring returns a newly allocated substring of string starting at index start including characters up to index end-1. The index of the first character is 0, and the index of the last character is the length of string minus one. If end is less or equal to start, the empty string is returned. end may be greater than the length of string. | ||||||||||||
R4RS Compliance | It's no error, when the second index end is out of bounds. In this case, the empty string or all characters upto the end of string are returned. | ||||||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (symbol? obj) | |||||||||
Parameters |
|
|||||||||
Description | symbol? returns #t for a symbol and #f for any other object. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (tan z) | |||||||||
Parameters |
|
|||||||||
Description | tan computes the tangent of the number z.
z is an angle measured in radians.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (tanh z) | |||||||||
Parameters |
|
|||||||||
Description | tanh computes the hyperbolic tangent of the number
z.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | LispMe extension | |||||||||
Examples |
|
Category | Primitive procedure | |||
Format | (text obj) | |||
Parameters |
|
|||
Description | text formats obj in
human-readable format and prints it as graphic text to the graphic
screen. Printing uses the graphics state
*gstate*
for starting coordinates, font, colors and drawing mode.
The current point in *gstate* is not updated. See here for details on the graphic state. The return value is #n to avoid trashing the graphics. |
|||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | Primitive procedure (MathLib required) | ||||||
Format | (truncate num) | ||||||
Parameters |
|
||||||
Description | truncate converts num to a floating point number and returns the integer part of it. The result is not a LispMe integer, it's a floating point value. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Special form | ||
Format |
|
||
Parameters |
|
||
Description | unquote evaluates exp in a quasiquote expression. The result is inserted into the template in place of the unquote expression. It's an error when unquote appears outside of a quasiquote expression. unquote may be abbreviated with a comma , | ||
R4RS Compliance | Full | ||
Examples | See quasiquote |
Category | Special form | ||
Format |
|
||
Parameters |
|
||
Description | unquote-splicing evaluates exp in a quasiquote expression. The expression must evaluate to a list. The opening and closing parentheses of this list are removed and all items are inserted in place of the unquote-splicing expression. It's an error when unquote-splicing appears outside of a quasiquote expression. It's also an error when the context is not a list or a vector. unquote-splicing may be abbreviated with comma at-sign ,@ | ||
R4RS Compliance | Full | ||
Examples | See quasiquote |
Category | Primitive procedure | |||||||||
Format | (vector obj1 ...) | |||||||||
Parameters |
|
|||||||||
Description | vector gathers its arguments into a vector and returns it. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (vector->list vec) | ||||||
Parameters |
|
||||||
Description | vector->list returns a newly allocated list of the elements of the vector vec. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (vector-length vec) | |||||||||
Parameters |
|
|||||||||
Description | vector-length returns the number of elements in vec. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (vector-ref vec index) | ||||||
Parameters |
|
||||||
Description | vector-ref returns the indexth element of vec. The index of the first element is 0, and the index of the last element is the length of vec minus one. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (vector-set! vec index obj) | ||||||
Parameters |
|
||||||
Description | vector-set! replaces the indexth element of vec by obj. The modified vector is returned. The index of the first element is 0, and the index of the last element is the length of vec minus one. It's no error to modify a constant vector in LispMe, as all values are heap-allocated and constant vectors are never shared, so the examples are valid. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (vector? obj) | |||||||||
Parameters |
|
|||||||||
Description | vector? returns #t for a vector and #f for any other object. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | |||
Format | (wait time) | |||
Parameters |
|
|||
Description | waits waits for time milliseconds. time must be positive or an error results. | |||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | Library procedure | |||
Format | (wait-pen) | |||
Parameters | none | |||
Description | wait-pen waits for a pen tap. When the pen event occurs, the pen coordinates are consed into a pair (x . y), which is returned. Both x and y coordinates are in the range [0..160]. | |||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | Primitive procedure | ||||||
Format | (write obj [outport]) | ||||||
Parameters |
|
||||||
Description | write prints an object to the output field or to the output port outport in machine-readable format, i.e. strings and chars are escaped as described here. A space character is appended after each object written. write returns obj. For related information, see display and newline. | ||||||
R4RS Compliance | optional port parameter not supported | ||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (write-record dbname recnum obj) | ||||||
Parameters |
|
||||||
Description | write-record opens the Pilot database named
dbname (case-sensitive!). recnum
must be a valid index for the database. If obj
is a string, a new record (filled with the string's contents)
is tried to be inserted into the database at the position
recnum and the actual insertion position is
returned as an integer. If obj is the value false, the record with index recnum is (permanently) deleted from the database (using DmRemoveRecord, not just setting the deleted attribute) and #t is returned on success. If the database or the index doesn't exist or any other error occurs, #f is returned in both cases. Warning: Don't try to create records for other apps when you're not absolutely sure about their data layout. Those apps often assume valid data in their databases and can crash badly otherwise! |
||||||
R4RS Compliance | LispMe extension. | ||||||
Examples |
|
Category | Library procedure | ||||||
Format | (zero? num) | ||||||
Parameters |
|
||||||
Description | zero? returns #t, if num is equal to zero. Otherwise it returns #f. See also positive? and negative?. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|