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 I

if

if conditionally evaluates one of two expressions.

Category Special form
Format (if test consequent [alternative])
Parameters
test any LispMe expression. Its value determines, if consequent or alternative is evaluated.
consequent any LispMe expression. It's evaluated when test is true.
alternative any LispMe expression. It's evaluated when test is false.
Description if evaluates test first. If this evaluates to true, consequent is evaluated and its value returned. Otherwise, alternative is evaluated and its value returned. Remember that '() is considered true in LispMe. If alternative is omitted, nothing is done and #f is returned.
R4RS Compliance Full
Examples
(if #t (* 4 5) '(foo)) => 20
(if (cdr '(a)) 5 2) => 5
(if (eq? 1 2) 0 8) => 8

imag-part

imag-part computes the imaginary part of a complex number.

Category Native procedure
Format (imag-part z)
Parameters
zany number
Description imag-part computes the imaginary part of the number z.
R4RS Compliance Full
Examples
(imag-part 5.1) => 0
(imag-part 0.5+2i) => 2
(imag-part 7.2@1.8) => 7.011702942323

index->rgb

index->rgb retrieves the actual RGB values for a palette entry.

Category Native procedure
Format (index->rgb col)
Parameters
colcolor number, an integer in the range 0-255
Description index->rgb reads the actual RGB values for the color number col from the system colortable and returns them as a newly allocated list of 3 integers each in the range 0-255.

On systems running older OS versions than 3.5, (0 0 0) is returned.

R4RS Compliance LispMe extension
Examples
(index->rgb 13) => (255 204 153)(256 colors)
(index->rgb 13) => (34 34 34)(16 grays)

inexact->exact

inexact->exact converts a (real) number to integer.

Category Native procedure
Format (inexact->exact num)
Parameters
numa real number
Description inexact->exact converts the floating point number num to an integer by truncating. If num is already an integer, integer just returns it. When required, a big integer may be returned.
R4RS Compliance Full
Examples
(inexact->exact 4.897632) => 4
(inexact->exact 1e30) => 1000000000000000019884624838656 (since reals have only 53 significant bits, the least significant bits are considered 0)

inexact?

inexact? tests if a number is inexact.

Category Native procedure
Format (inexact? num)
Parameters
numa number
Description inexact? returns #t for reals and complexs and #f for other numbers. LispMe doesn't support the exactness property of general numbers, all non-integer numbers are considered inexact.
R4RS Compliance Exactness property not stored
Examples
(inexact? 42) => #f
(inexact? 42.0) => #t

input

input parses data entered in a dialog box as a LispMe object.

Category Library procedure
Format (input prompt)
Parameters
promptany object
Description input displays a dialog where the user can input a LispMe object which will be returned. prompt is displayed as a prompt text in the input dialog. input uses the standard LispMe parser to create an object from its textual representation, so all kind of syntax errors are possible. The type of the object is solely determined by the data input.
R4RS Compliance LispMe extension. Note that this procedure was called read in earlier versions. This has been changed to avoid confusion with the R4RS read.
Examples
(input "Enter your income") => whatever you enter in the dialog

input-port?

input-port? recognizes a port opened for input.

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

input-string

input-string reads a string entered in a dialog box.

Category Library procedure
Format (input-string prompt)
Parameters
promptany object
Description input-string displays a dialog where the user can input any text which will be returned as a string. prompt is displayed as a prompt text in the input dialog. input-string accepts any text entered.
R4RS Compliance LispMe extension. Note that this procedure was called read-string in earlier versions. This has been changed to be consistent with input.
Examples
(input-string "I'm Eliza. Please state your problem.") => whatever you enter in the dialog as a string

integer

integer converts a number to integer.

Category Deprecated, use inexact->exact instead
Format (integer num)
Parameters
numa number
Description integer converts the floating point number num to an integer by truncating. If num is already an integer, integer just returns it. When required, a big integers may be returned. See also truncate.
R4RS Compliance LispMe extension
Examples
(integer 4.897632) => 4
(integer 1e30) => 1000000000000000019884624838656 (since reals have only 53 significant bits, the least significant bits are considered 0)

integer->char

integer->char creates a character from its ASCII code.

Category Primitive procedure
Format (integer->char int)
Parameters
intan integer
Description integer->char returns the char with the ASCII code int. Only the lower 8 bit of int are used (int mod 256). You should use a tool like AsciiChart to see characters and their codes on your Pilot.
R4RS Compliance Full
Examples
(integer->char 49) => #\1
(integer->char 1000) => #\è

integer?

integer? recognizes integer numbers.

Category Primitive procedure
Format (integer? obj)
Parameters
objany object
Description integer? returns #t for integer numbers and #f for any other object.
R4RS Compliance Full
Examples
(integer? 42) => #t
(integer? -1.234e-55) => #f
(integer? 1234665431654323123) => #t
(integer? 'foo) => #f

it

it contains the result of the last evaluation.

Category Variable
Format it
Description it is a variable which it automatically updated to the result of the last evaluation, so you can use it in subsequent evaluations.
R4RS Compliance LispMe extension

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