Comparison operators < <= > >= work with numbers, chars and strings, there are no separate comparison functions for them.
#f | #t | < | <= |
> | >= | and | boolean? |
case | cond | eq? | eqv? |
equal? | if | not | or |
eq? | gensym | symbol? |
Integer numbers are represented internally as unboxed data, so they can be compared with eq?. Use eqv? to compare arbitrary numbers.
Invalid operations with floating points do not abort the evaluation, but result in special IEEE-defined values infinity, -infinity and not-a-number (or may return complex results!), which print like this. The only exception is division by zero, which always causes an error to be consistent with integer division.
The exactness property of Scheme is not supported, all numbers are considered inexact?.
LispMe doesn't support R4RS procedures char<? etc. but extends the numeric comparison operators < <= > >= to work with characters, too. The ordering defined by these operators is the ordering of the corresponding ASCII codes.
To compare for equal characters, use eq?.
< | <= | > | >= | char->integer |
char? | eq? | integer->char | max | min |
LispMe doesn't support R4RS procedures string<? etc. but extends the numeric comparison operators < <= > >= to work with strings, too. The ordering defined by these operators is the lexicographic extension of the ordering of the underlying characters.
To compare for equal strings, use string=?, as eqv? is required to distinguish non-shared strings.
In LispMe equal written strings (including the empty string) are never shared.
The printing and scanning procedures object->string and string->object use an internal buffer which is limited to 4096 characters.
< | <= | > | >= | list->string |
max | min | object->string | string->list | string->object |
string-append | string-length | string-ref | string-set! | string=? |
string? | substring |
Lists are structures built from pairs where every cdr component is either a pair or the special object '() called the empty list.
'() | append | assoc | assq | assv |
c...r | car | cdr | cons | equal? |
length | list | list->string | list-ref | map |
member | memq | memv | memv | null? |
pair? | reverse | set-car! | set-cdr! | string->list |
list->vector | make-vector | vector | vector->list |
vector-length | vector-ref | vector-set! | vector? |
Closures have no sensible written representation, see here how they are printed.
Additionally, LispMe provides the meta-linguistic function eval, which interprets an expression as LispMe code.
apply | disasm | eval | for-each |
lambda | map | procedure? |
A continuation object can be created by the call/cc procedure, which expects a procedure of one argument. This procedure will be called with the current continuation as its parameter. This continuation looks like a procedure of one argument, but any time it is called afterwards, the argument will be the return value of the original call/cc application.
Continuations are a powerful control mechanism and can be used to implement non-local returns, exception handling, backtracking, or coroutines.
Continuations have no sensible written representation, see here how they are printed.
call/cc | continuation? |
Promises have no sensible written representation, see here how they are printed.
delay | force | promise? |
You can open an existing memo for reading with open-input-file, which returns an input port to be used with read, read-char, read-line, or peek-char. It's possible to open several input ports for the same memo; each port maintain its own read position.
LispMe ports don't need to be closed, so there are no procedures close-input-port or close-output-port. Additionally, MemoPad IO is quite robust, you can even delete a memo when a port is open without risking crashes!
LispMe provides other procedures, which read input from popup dialogs (the parameter is displayed as a prompt text in each case) and write output to the output field.
Additionally, there's a procedure wait-pen, which waits for a pen tap and returns the coordinates of the pen as a pair.
The graphic routines use device coordinates in the range (0,0) to (159,87). (0,0) corresponds to the upper left corner of the output field, which is in fact 17 pixels below screen coordinates (0,0). Remember this when using the coordinates returned by wait-pen, which are screen coordinates.
Drawing attributes like color, font and pattern are controlled via global variables. These variables are bound to fixed cells at LispMe startup, so you should never modify them with set!. Instead, use set-car! or set-cdr! to modify their components.
*font* | *pat* | *point* | draw | rect | text |