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

serial-get-cts

serial-get-cts gets the CTS timeout for a serial device.

Category Native procedure
Format (serial-get-cts serial)
Parameters
serialan open serial port
Description serial-get-cts returns the CTS timeout for the open serial port serial. The timeout is measured in ticks, there are (ticks-per-sec) ticks in a second.
R4RS Compliance LispMe extension
Examples
(serial-get-cts (open-serial #x8000 300 "8n1n")) => 500 (default)

serial-get-timeout

serial-get-timeout gets the receive timeout for a serial device.

Category Native procedure
Format (serial-get-timeout serial)
Parameters
serialan open serial port
Description serial-get-timeout returns the receive timeout for the open serial port serial. The timeout is measured in ticks, there are (ticks-per-sec) ticks in a second. The receive timeout specifies how long LispMe waits for data on a serial port. If no data arrives in time, EOF is assumed and the read operation is terminated.
R4RS Compliance LispMe extension
Examples
(serial-get-timeout (open-serial #x8000 300 "8n1n")) => 500 (default)

serial-info

serial-info returns information for a serial device.

Category Native procedure
Format (serial-info serial)
Parameters
serialan open serial port
Description serial-info returns general information about the open serial port serial as a list of 5 items:
  1. the creator ID of the device driver
  2. the device capabilities, see System/SerialMgr.h, a logical OR of the following flags:
    0x01serDevCradlePortHW controls RS-232 from cradle connector
    0x02serDevRS232SerialHW has RS-232 line drivers
    0x04serDevIRDACapablehas IR line drivers and generates IRDA mode serial
    0x08serDevModemPortdrives modem connection
    0x10serDevCncMgrVisibleport name to be displayed in Connection manager panel
    0x20serDevConsolePortis the default console port
    0x40serDevUSBCapableis USB driver for USB hardware connected to cradle
  3. the maximum baud rate for this device
  4. baud rate from which HW handshaking is recommended
  5. description text
R4RS Compliance LispMe extension
Examples
(serial-info (open-serial #x8000 300 "8n1n")) => ("uEZA" 31 115200 19200 "Serial")

serial-input

serial-input returns the input port to read from a serial device.

Category Native procedure
Format (serial-input serial)
Parameters
serialan open serial port
Description serial-input returns the input port associated with serial. This port can be used as an argument to read etc. to read data from the underlying serial device. Closing this port doesn't affect the serial device.
R4RS Compliance LispMe extension
Examples
(serial-input (open-serial #x8000 300 "8n1n")) => [inport 9 @0 [serial 49153 300 8N1N]]

serial-number

serial-number returns the serial number of the Palm device.

Category Native procedure
Format (serial-number)
Parameters
None
Description serial-number returns the serial number of the handheld device as a string. If there doesn't exist a serial number (e.g. with the Palm emulator), #f is returned.
R4RS Compliance LispMe extension
Examples
(serial-number) => "10GU13xxxxxx"

serial-output

serial-output returns the output port to write to a serial device.

Category Native procedure
Format (serial-output serial)
Parameters
serialan open serial port
Description serial-output returns the output port associated with serial. This port can be used as an argument to display etc. to write data to the underlying serial device. Closing this port doesn't affect the serial device.
R4RS Compliance LispMe extension
Examples
(serial-output (open-serial #x8000 300 "8n1n")) => [outport 9 @0 [serial 49153 300 8N1N]]

serial-receive-flush

serial-receive-flush flushes the receive buffer of a serial device.

Category Native procedure
Format (serial-receive-flush serial)
Parameters
serialan open serial port
Description serial-receive-flush discards all data in the receive buffer of the serial device serial. If during the receive timeout (see serial-get-timeout) more data arrives, the buffer is flushed again, the timeout counter is reset, and the function waits again. The return value is #t is successful, #f otherwise.
R4RS Compliance LispMe extension
Examples
(serial-receive-flush (open-serial #x8000 300 "8n1n")) => #t

serial-send-flush

serial-send-flush flushes the send buffer of a serial device.

Category Native procedure
Format (serial-send-flush serial)
Parameters
serialan open serial port
Description serial-send-flush discards any data not yet sent from the send buffer of the serial device serial. The return value is #t is successful, #f otherwise.
R4RS Compliance LispMe extension
Examples
(serial-send-flush (open-serial #x8000 300 "8n1n")) => #t

serial-set-break!

serial-set-break! controls the break signal on a serial device.

Category Native procedure
Format (serial-set-break! serial set)
Parameters
serialan open serial port
seta boolean
Description serial-set-break! sets or clears the Break signal on the open serial port serial. The signal is set when set is #t, cleared otherwise. The return value is #t when successful, #f otherwise,
R4RS Compliance LispMe extension
Examples
(serial-set-break! (open-serial #x8000 300 "8n1n") 1000) => #t

serial-set-cts!

serial-set-cts! sets the CTS timeout for a serial device.

Category Native procedure
Format (serial-set-cts! serial timeout)
Parameters
serialan open serial port
timeoutan integer
Description serial-set-cts! sets the CTS timeout for the open serial port serial. The timeout is measured in ticks, there are (ticks-per-sec) ticks in a second. If successfull, #t is returned, #f otherwise.
R4RS Compliance LispMe extension
Examples
(serial-set-cts! (open-serial #x8000 300 "8n1n") 1000) => #t

serial-set-irda!

serial-set-irda! enables/disables IrDA connection for a serial device.

Category Native procedure
Format (serial-set-irda! serial set)
Parameters
serialan open serial port
seta boolean
Description serial-set-irda! enables or disables IrDA connections on the open serial port serial. IrDA is enabled when set is #t, disabled otherwise. The return value is #t when successful, #f otherwise,
R4RS Compliance LispMe extension
Examples
(serial-set-irda! (open-serial #x8001 300 "8n1n") #t) => #t

serial-set-rx!

serial-set-rx! enables/disables the IrDA receiver for a serial device.

Category Native procedure
Format (serial-set-rx! serial set)
Parameters
serialan open serial port
seta boolean
Description serial-set-rx! enables or disables the IrDA receiver for the open serial port serial. The receiver is enabled when set is #t, disabled otherwise. The return value is #t when successful, #f otherwise,
R4RS Compliance LispMe extension
Examples
(serial-set-rx! (open-serial #x8001 300 "8n1n") #f) => #t

serial-set-timeout!

serial-set-timeout! sets the receive timeout for a serial device.

Category Native procedure
Format (serial-set-timeout! serial timeout)
Parameters
serialan open serial port
timeoutan integer
Description serial-set-timeout! sets the receive timeout for the open serial port serial. The timeout is measured in ticks, there are (ticks-per-sec) ticks in a second. The return value is timeout.
R4RS Compliance LispMe extension
Examples
(serial-set-timeout! (open-serial #x8000 300 "8n1n") 100) => 100

serial-status

serial-status returns the status of a serial device.

Category Native procedure
Format (serial-status serial)
Parameters
serialan open serial port
Description serial-status returns the current status of the open serial port serial as a pair of status flags and the number of line errors. The status is the logical or of the following bit flags (see System/SerialMgr.h):
0x01srmCtsOnCTS signal is on
0x02srmRtsOnRTS signal is on
0x04srmDsrOnDSR signal is on
0x08srmBreakSigOnBreak signal is on
R4RS Compliance LispMe extension
Examples
(serial-status (open-serial #x8000 300 "8n1n")) => (3 . 0)

serial?

serial? recognizes serial ports.

Category Primitive procedure
Format (serial? obj)
Parameters
objany object
Description serial? returns #t for a serial port and #f for any other object.
R4RS Compliance LispMe extension
Examples
(serial? 'foo) => #f
(serial? (open-serial #x8001 1200 "7e1h")) => #t

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-sys-pref

set-sys-pref sets a value in the system preferences.

Category Native procedure
Format (set-sys-pref n val)
Parameters
na small integer
valan integer
Description set-sys-pref converts val to an unsigned 32 bit integer and sets it as the value of the PalmOS system preference with the index n. This index corresponds to the enumeration SystemPreferencesChoice defined in System/Preferences.h The value returned is n

See also get-sys-pref.

R4RS Compliance LispMe extension
Examples
(set-sys-pref 33 1) => 33
and enables IR sniffing
(set-sys-pref 22 (buf-get-u32 "fbLM" 0)) => 22
and puts LispMe on the ToDo hardware button (entry 22 is prefHard3CharAppCreator)

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

strarr-length

strarr-length counts the strings in a string array.

Category Native procedure
Format (strarr-length stringarray)
Parameters
stringarraya string array
Description strarr-length returns the number of strings in string array.
R4RS Compliance Full
Examples
(strarr-length (make-strarr '())) => 0
(strarr-length (make-strarr '(a b c d e))) => 5

strarr-ref

strarr-ref returns a string from a string array by index.

Category Native procedure
Format (strarr-ref stringarray index)
Parameters
stringarraya string array
indexan integer
Description strarr-ref returns the indexth string of stringarray. The index of the first string is 0, and the index of the last string is the length of stringarray minus one.
R4RS Compliance LispMe extension
Examples
(strarr-ref (make-strarr '(foo 4711 "bar")) 1) => "4711"

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-lower

string-lower converts a string to lower case.

Category Native procedure
Format (string-lower string)
Parameters
stringa string
Description string-lower creates a newly allocated string containing the characters of string converted to lower case. Accented chars are converted correctly. Please note that there is no string-upper, since the Palm API doesn't have this functionality, either.
R4RS Compliance LispMe extension
Examples
(string-lower "FOO") => "foo"
(string-lower "DÉJÀ Vu") => "déjà vu"

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