Back to index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Other

Alphabetic catalog of Language elements S

scl-enter

scl-enter is posted when a scrollbar is tapped.

Category UI event
Format (scl-enter id)
Parameters
idthe form id of the tapped scrollbar
Description scl-enter is the event posted when the user has tapped a scrollbar but not yet lifted the pen.

scl-exit

scl-exit is posted when a scrollbar has been released.

Category UI event
Format (scl-exit id new)
Parameters
idthe form id of the scrollbar
newthe new scroll value (an integer)
Description scl-exit is posted when the user has finished moving a scrollbar.

scl-get-val

scl-get-val returns the values of a scrollbar.

Category Native procedure
Format (scl-get-val id)
Parameters
idthe form id of the scrollbar
Description scl-get-val returns the values of the scrollbar with id id as a list of 4 integers:
  1. the current position of the knob
  2. the minimum (top position)
  3. the maximum (botton) position
  4. the page size (indicates knob size)
The scrollbar is invisible when minimum and maximum are the same.

Have a look at the sample program showing the interaction between fields and scrollbars.

R4RS Compliance LispMe extension
Examples
(scl-get-val 1500) => (4 0 20 8)

scl-repeat

scl-repeat is posted when a scrollbar is dragged.

Category UI event
Format (scl-repeat id new old)
Parameters
idthe form id of the scrollbar
newthe new scroll value (an integer)
oldthe old scroll value (an integer)
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.

scl-set-val

scl-set-val sets the values of a UI scrollbar.

The return value is vals.

Have a look at the sample program showing the interaction between fields and scrollbars.

Category Native procedure
Format (scl-set-val id vals)
Parameters
idthe form id of the control
valsmust be a list of 4 integers as described below.
Description scl-set-val sets the values of the scrollbar with id id. vals must be a list of 4 integers indicating:
  1. the current position of the knob
  2. the minimum (top position)
  3. the maximum (botton) position
  4. the page size (used for page scrolling)
The scrollbar will be made invisible when minimum and maximum are the same.
R4RS Compliance LispMe extension
Examples
(scl-set-val 1500 '(5 0 10 3)) => (5 0 10 3) and positions the knob of the scrollbar into the middle

set!

set! modifies a variable.

Category Special form
Format (set! var expr)
Parameters
varan identifier
exprany expression
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
(let ((a 0)) (set! a 3) a) => 3
(let ((a 0)) (set! b 3) b) => error

set-car!

set-car! modifies the car component of a pair.

Category Primitive procedure
Format (set-car! pair obj)
Parameters
paira pair
objany object
Description set-car! changes the car component of pair to obj and returns the modified pair.
R4RS Compliance Full
Examples
(let ((a '(a b c))) (set-car! a 3) a) => (3 b c)

set-cdr!

set-cdr! modifies the cdr component of a pair.

Category Primitive procedure
Format (set-cdr! pair obj)
Parameters
paira pair
objany object
Description set-cdr! changes the cdr component of pair to obj and returns the modified pair.
R4RS Compliance Full
Examples
(let ((a '(a b c))) (set-cdr! a 3) a) => (a . 3)

set-clipboard-text

set-clipboard-text sets the system clipboard.

Category Native procedure
Format (set-clipboard-text obj app?)
Parameters
objany object
app?a boolean
Description set-clipboard-text sets the contents of the system clipboard to the printed representation of obj (by using display). If app? is #f, the current clipboard content is replaced, otherwise obj is appended to the current content. The return value is always obj.
R4RS Compliance LispMe extension
Examples
(set-clipboard-text "foo" #t) => "foo" and appends "foo" to the clipboard

set-palette

set-palette modifies a palette entry.

Category Native procedure
Format (set-palette index r g b)
Parameters
indexan integer in the range 0-255, the index
ran integer in the range 0-255, red part
gan integer in the range 0-255, green part
ban integer in the range 0-255, blue part
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
(set-palette 231 35 78 250) => 231 and makes the first user-defined color a nice medium blue

set-resdb

set-resdb sets the name of the resource DB for the user interface.

Category Deprecated
Format (set-resdb str)
Parameters
stra string or false
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.

Beginning with LispMe 3.0, this procedure is obsolete. Setting a special resource database is no more necessary. Instead, LispMe will find the needed resources in any open resource database. If you want to store a reference to an open resource database, the *resdb* variable comes handy.

R4RS Compliance LispMe extension
Examples
(set-resdb "demo") => "demo" and sets demo as current resource DB

set-ticks!

set-ticks! updates a ticks value.

Category Native procedure
Format (set-ticks! ticks)
Parameters
ticksa "ticks" value
Description set-ticks! updates the ticks value ticks to the current ticks (since device reset). The return value is the assigned ticks value.
R4RS Compliance LispMe extension
Examples
(set-ticks! tick) => 2247316 (for example)

sin

sin computes the sine of a number.

Category Primitive procedure (MathLib required)
Format (sin z)
Parameters
zany number
Description sin computes the sine of the number z. z is an angle measured in radians.

For complex arguments z = x + yi, the formula

sin z = sinx coshy + i cosx sinhy
is used.
R4RS Compliance Full
Examples
(sin 0) => 0
(sin 1) => 0.841470984807896
(sin 0.5+2i) => 1.80369269553218+3.18286944833715i

sinh

sinh computes the hyperbolic sine of a number.

Category Primitive procedure (MathLib required)
Format (sinh z)
Parameters
zany number
Description sinh computes the hyperbolic sine of the number z.

For complex arguments z = x + yi, the formula

sinh z = sinhx cosy + i coshx siny
is used.
R4RS Compliance LispMe extension
Examples
(sinh 0) => 0
(sinh 1) => 1.1752011936438
(sinh 0.5+2i) => -0.216852162920789+1.02534738858398i

socket-down?

socket-down? returns if a socket has been shut down.

Category Native procedure
Format (socket-down? socket)
Parameters
socketa socket
Description socket-down? returns #t if the socket socket has been shut down by socket-shutdown or #f otherwise.
R4RS Compliance LispMe extension
Examples
(socket-down? (make-client-socket "localhost" 4711)) => #f

socket-host-address

socket-host-address returns the host address of a socket.

Category Native procedure
Format (socket-host-address socket)
Parameters
socketa socket
Description socket-host-address returns a string containing the IP address of the distant host attached to socket.
R4RS Compliance LispMe extension
Examples
(socket-host-address (make-client-socket "localhost" 4711)) => "127.0.0.1"

socket-hostname

socket-hostname returns the hostname of a socket.

Category Native procedure
Format (socket-hostname socket)
Parameters
socketa socket
Description socket-hostname returns a string containing the official name of the distant host attached to socket.
R4RS Compliance LispMe extension
Examples
(socket-hostname (make-client-socket "localhost" 4711)) => "BAYERF01M" (that's the name of my development machine)

socket-input

socket-input returns the input port to read from a socket.

Category Native procedure
Format (socket-input socket)
Parameters
socketa socket
Description socket-input returns the input port associated with socket. This port can be used as an argument to read etc. to read data from the underlying socket. When this port is closed by close-input-port, the socket is shut down in input direction.
R4RS Compliance LispMe extension
Examples
(socket-input (make-client-socket "localhost" 4711)) => [inport 4 @0 [socket 1]]

socket-local-address

socket-local-address returns the local address of a socket.

Category Native procedure
Format (socket-local-address socket)
Parameters
socketa socket
Description socket-local-address returns a string containing the IP address of the local host attached to socket.
R4RS Compliance LispMe extension
Examples
(socket-local-address (make-client-socket "localhost" 4711)) => "127.0.0.1"

socket-output

socket-output returns the output port to write to a socket.

Category Native procedure
Format (socket-output socket)
Parameters
socketa socket
Description socket-output returns the output port associated with socket. This port can be used as an argument to display etc. to write data to the underlying socket. When this port is closed by close-output-port, the socket is shut down in output direction.
R4RS Compliance LispMe extension
Examples
(socket-output (make-client-socket "localhost" 4711)) => [outport 4 [socket 1]]

socket-port-number

socket-port-number returns the port number of a socket.

Category Native procedure
Format (socket-port-number socket)
Parameters
socketa socket
Description socket-port-number returns an integer which is the port number of the local host attached to socket.
R4RS Compliance LispMe extension
Examples
(socket-port-number (make-client-socket "localhost" 4711)) => 1032

socket-shutdown

socket-shutdown shuts down a socket.

Category Native procedure
Format (socket-shutdown socket [close])
Parameters
socketa socket
close(optional) a boolean
Description socket-shutdown shuts down the socket socket in both input and output directions and optionally closes it if close is not #f or is omitted.
R4RS Compliance LispMe extension
Examples
(socket-shutdown (make-client-socket "localhost" 4711)) => [closed socket]

socket?

socket? recognizes sockets.

Category Primitive procedure
Format (socket? obj)
Parameters
objany object
Description socket? returns #t for a socket and #f for any other object.
R4RS Compliance LispMe extension
Examples
(socket? "localhost") => #f
(socket? (make-client-socket "localhost" 4711)) => #t

sound

sound plays a (pseudo-)musical sound.

Category Native procedure
Format (sound freq time)
Parameters
freqan integer >= 128
timea positive integer
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
(sound 440 1000) => #n and plays reference "a" for 1 second

sqrt

sqrt computes the square root of a number.

Category Primitive procedure (MathLib required)
Format (sqrt z)
Parameters
zany number
Description sqrt returns the square root of a number z.
R4RS Compliance Full
Examples
(sqrt 9) => 3
(sqrt 2) => 1.41421356237309
(sqrt -2) => +1.41421356237309i

string->list

string->list converts a string to the list of its characters.

Category Native procedure
Format (string->list string)
Parameters
stringa string
Description string->list returns a newly allocated list of the characters in string.
R4RS Compliance Full
Examples
(string->list "Foobar") => (#\F #\o #\o #\b #\a #\r)
(string->list "\\#ff") => (#\\ #\ÿ)
(string->list "") => ()

string->object

string->object parses a string as a LispMe object.

Category Primitive procedure
Format (string->object string)
Parameters
stringa string
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
(string->object "Foobar") => foobar
(string->object "\"Foobar\"") => "Foobar"
(string->object "(a (b) c)") => (a (b) c)
(string->object "1E3") => 1000

string-append

string-append concatenates strings.

Category Primitive procedure
Format (string-append stringi ...)
Parameters
stringiany string
Description string-append returns a newly allocated string, which is the concatenation of all the stringi in the order written.
R4RS Compliance Full
Examples
(string-append "foo" " bar" "baz") => "foo barbaz"
(string-append "hello") => "hello" (use this idiom to copy a string)
(string-append) => ""

string-length

string-length counts the characters in a string.

Category Primitive procedure
Format (string-length string)
Parameters
stringa string
Description string-length returns the number of characters in string.
R4RS Compliance Full
Examples
(string-length "Foobar") => 6
(string-length "\\#ff") => 2
(string-length "") => 0

string-ref

string-ref returns a character in a string by index.

Category Primitive procedure
Format (string-ref string index)
Parameters
stringa string
indexan integer
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
(string-ref "baz" 1) => #\a
(string-ref "hello" 5) => error

string-set!

string-set! replaces a character in a string.

Category Primitive procedure
Format (string-set! string index char)
Parameters
stringa string
indexan integer
chara character
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
(string-set! "baz" 2 #\r) => "bar"
(string-set! "hello" -1 #\x) => error

string-tokenize

string-tokenize splits a string into a list on separator chars.

Category Native procedure
Format (string-tokenize string sepset)
Parameters
stringa string
sepseta string of separator chars
Description string-tokenize creates a list of strings which are obtained by splitting string into substrings terminated by any of the characters in sepset. This function is similar to C's strtok() but returns all tokens at once.
R4RS Compliance LispMe extension
Examples
(string-tokenize "a b,cd;efm," " ,;") => ("a" "b" "cd" "efm")

string=?

string=? compares two strings.

Category Primitive procedure
Format (string=? string1 string2)
Parameters
string1a string
string2a string
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
(string=? "ab" "abc") => #f
(string=? "foo" "foo") => #t
(string=? "Foo" "foo") => #f

string?

string? recognizes strings.

Category Primitive procedure
Format (string? obj)
Parameters
objany object
Description string? returns #t for a string and #f for any other object.
R4RS Compliance Full
Examples
(string? #\x) => #f
(string? "x") => #t
(string? 'x) => #f

substring

substring returns s substring of a string.

Category Primitive procedure
Format (substring string start end)
Parameters
stringa string
startan integer
endan integer
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
(substring "foobar" 2 4) => "ob"
(substring "foobar" 3 100) => "bar"
(substring "foobar" 4 1) => ""
(substring "foobar" 7 8) => error

symbol?

symbol? recognizes symbols.

Category Primitive procedure
Format (symbol? obj)
Parameters
objany object
Description symbol? returns #t for a symbol and #f for any other object.
R4RS Compliance Full
Examples
(symbol? 'foo) => #t
(symbol? 42) => #f
(symbol? '()) => #f

Back to index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Other