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 # - ?

#f

#f is the value false.

Category Constant
Format #f
Description #f is the only boolean value false. It is self-evaluating, so quoting is not necessary. Note that #f and '() are different values in LispMe, so '() means true in logical expressions.
R4RS Compliance Full
Examples
(boolean? '()) => #f
(boolean? #f) => #t
(if #f 1 0) => 0
(if '() 1 0) => 1

#n

#n is a value, which does not print.

Category Constant
Format #n
Description #n is a special object, which suppresses printing when it's the result of an evaluation. When #n is imbedded in a list, it will print as #n, but when the entire result is #n, nothing will be printed at all. This is especially useful for graphics programs, as any output caused by the REP-loop overwrites the graphics.
R4RS Compliance LispMe extension
Examples
#n => #n (but you won't see it printed)
'(#n) => (#n) (prints normally)

#t

#t is the canonical value true.

Category Constant
Format #t
Description #t is the canonical boolean value true. It is self-evaluating, so quoting is not necessary. Note that all objects other than #f mean true in logical expressions.
R4RS Compliance Full
Examples
(boolean? #t) => #t
(if #t 1 0) => 1
(if 'foo 1 0) => 1

'()

'() is the empty list.

Category Constant
Format '()
Description '() or (quote ()) is the empty list. There's no nil in LispMe (anymore), use '() instead. Though you can omit the apostrophe when writing the empty list, it's not recommended. Note that '() and #f are different values in LispMe, so '() means true in logical expressions.
R4RS Compliance Full
Examples
(null? '()) => #t
(null? #f) => #f
(pair? '()) => #f
(if '() 1 0) => 1

*

* multiplies numbers.

Category Primitive procedure
Format (* numi ...)
Parameters
numia number
Description * multiplies any number of arbitrary numbers. Type conversion (integer to real, real to complex) is handled automatically.
R4RS Compliance Full
Examples
(* 6 7) => 42
(* 1.34 2.9 0.1 93-14.7i) => 36.1398-5.71242i
(*) => 1
(* 3 'a) => error

*gstate*

*gstate* contains the entire graphics state.

Category Variable
Format *gstate*
Description *gstate* is a list containing the entire state of the graphics system, like penposition, colors etc. The exact format is described here. This variable can be assigned to without restrictions.
R4RS Compliance LispMe extension

*hist*

*hist* contains the last expressions evaluated.

Category Variable
Format *hist*
Description *hist* is a list containing the last 12 expressions evaluated. When evaluating an expression from the top level by pressing the Eval button (not by loading or by re-evaluating from the history popup), the source expression is pushed onto this history list (and eventually older expressions vanish from it). You can repeat evaluation by choosing one expression from the history popup later.

To gain flexibility, the history list is available explicitly with this variable, so you can change it programatically, e.g. to prepare a set of typical invocations for your program in a session to be distributed. Or create a simplistic dialog where your program changes the history before printing its answer to let the user select his input from a multiple-choice list.

R4RS Compliance LispMe extension

*net-timeout*

*net-timeout* contains the timeout for socket operations.

Category Variable
Format *net-timeout*
Description *net-timeout* contains a single integer (default 1000) which is the time in ticks (see ticks-per-sec) after which I/O operations to sockets fail.
R4RS Compliance LispMe extension

*outfield*

*outfield* is the output port for the output field.

Category Variable
Format *outfield*
Description *outfield* contains an output port to access the output field in a uniform fashion. You should not modify this variable!
R4RS Compliance LispMe extension

*resdb*

*resdb* contains the current resource database.

Category Variable
Format *resdb*
Description *resdb* is a handy place to store the current resource database (for UI resources, e.g.). In Fact, LispMe doesn't need this variable, since PalmOS manages open resource databases itself, but it's quite convenient to have it. Remember that LispMe's pickling mechanism automatically reopens all databases that have been closed on last exit.
R4RS Compliance LispMe extension
Examples
(set! *resdb* (dm-open-db "GUIDemo" 1)) => [dbref 0x0001 GUIDemo]

+

+ adds numbers.

Category Primitive procedure
Format (+ numi ...)
Parameters
numia number
Description + adds any number of arbitrary numbers. Type conversion (integer to real, real to complex) is handled automatically.
R4RS Compliance Full
Examples
(+ 4 7) => 11
(+ 3.6 -2.1 8-i) => 9.5-i
(+) => 0
(+ 50 'a) => error

-

- subtracts two numbers or negates a number.

Category Primitive procedure
Format (- num1 [num2])
Parameters
num1a number
num2(optional) a number
Description When given one number, - negates it, when given two numbers, - calculates the difference of them. Type conversion (integer to real, real to complex) is handled automatically.
R4RS Compliance Full
Examples
(- 4 7-3i) => -3+3i
(- 17.89) => -17.89
(- 'a) => error

/

/ divides two numbers or inverts a number.

Category Primitive procedure
Format (/ num1 [num2])
Parameters
num1a number
num2(optional) a number
Description When given one number, / returns its inverse, when given two numbers, / divides them. If both of them are integers and the division leaves no remainder, the result is also an integer. Type conversion (integer to real, real to complex) is handled automatically. Division by zero is an error.
R4RS Compliance Full
Examples
(/ 4) => 0.25
(/ 16 4) => 4
(/ 16 3) => 5.33333333333333
(/ 16 3-4i) => 1.92+2.56i
(/ 16 0) => error

< <= > >=

<, <=, >, and >= compare two objects.

Category Primitive procedures
Formats
(< comp1 comp2)
(<= comp1 comp2)
(> comp1 comp2)
(>= comp1 comp2)
Parameters
comp1a comparable object
comp2a comparable object
Description These procedures compare two objects of compatible types and return their relation, either #t or #f. Both objects must be either
  • non-complex numbers: compare arithmetically
  • chars: compare ASCII codes
  • strings: compare lexicographically
Otherwise an error is signalled.
R4RS Compliance In addition to arithmetic comparison, these procedures deal with chars and strings, too, and thus subsume the R4RS procedures char<?, char<=?, char>?, char>=?, string<?, string<=?, string>?, and string>=?.

Only two arguments are accepted in each case

Examples
(< "ab" "abc") => #t
(>= 3 3.0) => #t
(<= #\a #\A) => #f

=

= tests if a two numbers are equal.

Category Primitive procedure
Format (= obj1 obj2)
Parameters
obj1any object
obj2any object
Description = returns #t, if obj1 is equivalent to obj2. Otherwise it returns #f.Since in LispMe equivalent numbers are numerically equal (and vice versa), this procedure is identical to eqv?
R4RS Compliance It is no error to compare non-numeric objects.
Examples
(= 1 1.0) => #t
(= 2 3) => #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