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? |
Small integer numbers are represented internally as unboxed data, so they can be compared with eq?, but I recommend using 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.
Big integers are stored in separate database records and may thus be 64 kByte binary integers which is about 2219. For logical operations, bigints are treated as binary integers in 2's complement (though they aren't stored this way), assuming an infinite string of 0 bits for positive numbers to the left and an infinite string of 1 bits for negative numbers to the left of the actually stored portion of the binary number. So, e.g., the logical bit-and is negative, iff both arguments are negative (that means having an infinite string of 1s to the left)
The exactness property of Scheme is not supported, all integers are considered exact?, all real and complex 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 | make-string | min | object->string | string->list |
string->object | string-append | string-length | string-lower | 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 maintains its own read position.
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.
delete-file | dir | display | eof_object? | input |
input-port? | input-string | newline | open-append-file | open-input-file |
open-output-file | output-port? | peek-char | port? | read |
read-char | read-line | write |