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 O

object->string

object->string prints an object to a string.

Category Primitive procedure
Format (object->string obj)
Parameters
objany object
Description object->string uses the standard LispMe printer to build the textual representation of obj as a string. The printing convention of write is used. The resulting string is truncated to 4096 characters.
R4RS Compliance LispMe extension. object->string subsumes R4RS procedures symbol->string and number->string.
Examples
(object->string 'Foobar) => "foobar"
(object->string "Foobar") => "\"Foobar\""
(object->string #\x) => "\#\\x"
(object->string '(a (b) c)) => "(a (b) c)"
(object->string -1.234) => "-1.234"

odd?

odd? tests, if a number is odd.

Category Native procedure
Format (odd? int)
Parameters
intan integer
Description odd? returns #t, if int is odd. Otherwise it returns #f. See also even?.
R4RS Compliance Full
Examples
(odd? 42) => #f
(odd? 29872634598762343) => #t
(odd? 1.23) => error

open-append-file

open-append-file opens an existing memo for appending output.

Category Native procedure
Format (open-append-file string)
Parameters
stringa string naming the memo
Description open-append-file searches a memo with name string and opens it for output, which will be appended to its former contents. If the memo doesn't exist, a new one is created like by open-output-file For more information about files/memos see here.
R4RS Compliance LispMe extension
Examples
(open-append-file "foo") => [outport] and opens the memo with first line foo for output

open-input-file

open-input-file opens an existing memo for input.

Category Native procedure
Format (open-input-file string [type])
Parameters
stringa string naming the memo
typean optional integer describing the file type
Description open-input-file searches a memo or DOC with name string and returns the input port associated with the opened memo. If the memo doesn't exist, an error is raised.

Possible file types are
0 (default)PT_MEMOStandard Palm Memo
1PT_MEMO32pedit Memo-like file, upto 32k
2PT_DOCDOC file, both compressed and uncompressed
For more information about files/memos see here.

R4RS Compliance Full
Examples
(open-input-file "foo") => [inport 4] provided there exists a new memo with first line foo

open-input-list

open-input-list opens a string list for input.

For more information about files/memos see here.
Category Native procedure
Format (open-input-list list)
Parameters
lista list consisting of strings
Description open-input-list creates an input port delivering the contents of each string in list. This procedure is in fact a by-product of LispMe's port implementation but is sometimes useful since it avoids allocating a temporary big string in some cases.
R4RS Compliance LispMe extension
Examples
(read (open-input-list '("he" "llo world"))) => hello

open-input-string

open-input-string opens a string for input.

For more information about files/memos see here.
Category Native procedure
Format (open-input-string string)
Parameters
stringa string
Description open-input-string creates an input port delivering the contents of string.
R4RS Compliance LispMe extension
Examples
(read (open-input-string "hello world")) => hello

open-output-file

open-output-file opens a new memo for output.

Category Native procedure
Format (open-output-file string [type])
Parameters
stringa string naming the memo
typean optional integer describing the file type
Description open-output-file creates a new memo with name string and returns the output port associated with the new memo.

Possible file types are
0 (default)PT_MEMOStandard Palm Memo
1PT_MEMO32pedit Memo-like file, upto 32k
2PT_DOCDOC file, only uncompressed files are written
For more information about files/memos see here.

R4RS Compliance Full
Examples
(open-output-file "foo") => [outport] and creates a new memo with first line foo

open-output-string

open-output-string creates a string output port.

Category Native procedure
Format (open-output-string)
Parameters None
Description open-output-string creates a new port which accumulates output into a string and returns this string output port. The accumulated output can be accessed by get-output-string.
R4RS Compliance LispMe extension
Examples
(let ((p (open-output-string)))
  (write (list 'foo 42) p)
  (get-output-string p))
=> "(foo 42)"

open-serial

open-serial opens a serial port.

Category Native procedure
Format (open-serial id baud options)
Parameters
idan integer specifying the port id
baudan integer specifying the baud rate
optionsa string of length 4
Description open-serial opens a serial port and returns it. id identifies the port to use, see here for possible values. When the old Serial manager is used (with older PalmOS versions), the port id is ignored.

baud is the baud rate of the port and be any of the standard values 110, 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 (and possibly more with USB)

options is a four-character string specifying connection options:

  1. The first char gives the number of bits per character and can be 5, 6, 7, or 8.
  2. The second char gives the parity and can be n for none, e for even, or o for odd.
  3. The third char gives the number of stop bits and can be 1 or 2.
  4. The fourth char specifies the flow control and can be n for none, c for CTS auto, r for RTS auto, or h for both RTS and CTS (= hardware). Software flow control via Xon/Xoff is not supported since the Palm API doesn't, either.
If the port cannot be opened, #f is returned.
R4RS Compliance LispMe extension
Examples
(open-serial #x8000 38400 "7e2h") => [serial 49153 38400 7E2H]

or

or is the non-strict logical disjunction of expressions.

Category Special form
Format (or expr1 ...)
Parameters
expri any expression.
Description or evaluates the expri in left to right order. If any expression is true, the evaluation is finished. In any case, the value of the last expression evaluated is returned. Remember that '() is considered true in LispMe.
R4RS Compliance Full
Examples
(or 4 5) => 4
(or #f "foo" 5) => foo
(or) => #f

output-port?

output-port? recognizes a port opened for output.

Category Primitive procedure
Format (output-port? obj)
Parameters
objany object
Description output-port? returns #t for a port opened for output by open-output-file and #f for any other object.
R4RS Compliance Full
Examples
(output-port? (open-output-file "foo")) => #t
(output-port? (open-input-file "bar")) => #f
(output-port? "baz") => #f

own-gui

own-gui switches event-handling of LispMe's dialog.

Category Primitive procedure
Format (own-gui switch)
Parameters
switchany object
Description When switch is true, most controls and fields in LispMe's main dialog are set unusable, so that they won't respond to events and you can handle events by yourself. The only exception is the break button which is never disabled to allow interrupting the process.

When switch is false, LispMe's main dialog responds to events as usual. The return value is switch.

R4RS Compliance LispMe extension
Examples
(own-gui #t) => #t

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