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 |
|
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 |
|
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 |
|
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 |
|
Category | Primitive procedure | ||||||||||||
Format | (* numi ...) | ||||||||||||
Parameters |
|
||||||||||||
Description | * multiplies any number of arbitrary numbers. Type conversion (integer to real, real to complex) is handled automatically. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
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 |
Category | Primitive procedure | ||||||||||||
Format | (+ numi ...) | ||||||||||||
Parameters |
|
||||||||||||
Description | + adds any number of arbitrary numbers. Type conversion (integer to real, real to complex) is handled automatically. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (- num1 [num2]) | |||||||||
Parameters |
|
|||||||||
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 |
|
Category | Primitive procedure | |||||||||||||||
Format | (/ num1 [num2]) | |||||||||||||||
Parameters |
|
|||||||||||||||
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 |
|
Category | Primitive procedures | |||||||||
Formats |
|
|||||||||
Parameters |
|
|||||||||
Description | These procedures compare two objects of compatible types and return
their relation, either #t or #f. Both objects must
be either
|
|||||||||
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 |
|
Category | Library procedure | ||||||
Format | (= num1 num2) | ||||||
Parameters |
|
||||||
Description | = returns #t, if num1 is equal to num2. Otherwise it returns #f. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Library procedure | ||||||
Format | (abs num) | ||||||
Parameters |
|
||||||
Description | abs computes the absolute value of num. The type of the result is the same as the argument's, with the exception of -16384, as it is not representable as an integer and therefore coerced to a float. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure (MathLib required) | ||||||||||||
Format | (acos z) | ||||||||||||
Parameters |
|
||||||||||||
Description | acos computes the arc cosine of z
in radians.
For complex arguments z = x + yi,
the formula |
||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | ||||||||||||
Format | (acosh z) | ||||||||||||
Parameters |
|
||||||||||||
Description | acosh computes the hyperbolic arc cosine
of z.
For complex arguments z = x + yi,
the formula |
||||||||||||
R4RS Compliance | LispMe extension | ||||||||||||
Examples |
|
Category | Special form | |||||||||
Format | (and expr1 ...) | |||||||||
Parameters |
|
|||||||||
Description | and evaluates the expri in left to right order. If any expression is false, 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 |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (angle z) | |||||||||
Parameters |
|
|||||||||
Description | angle computes the angle of the number z. The angle is always in the range -pi (exclusive) and pi (inclusive). See also atan. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (append listi ...) | ||||||||||||
Parameters |
|
||||||||||||
Description | append creates a list consisting of all the elements of the listi in the order of the arguments. The original lists are not modified, but the last list is not copied and shares structure with the result. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedure | ||||
Format | (apply procedure arglist) | ||||
Parameters |
|
||||
Description | apply calls procedure passing
each element in arglist to
procedure. The result of calling
procedure is returned. apply is especially useful when dealing with procedures with variable length argument lists, see examples. | ||||
R4RS Compliance | Full | ||||
Examples |
|
Category | Primitive procedure (MathLib required) | ||||||||||||
Format | (asin z) | ||||||||||||
Parameters |
|
||||||||||||
Description | asin computes the arc sine of z
in radians.
For complex arguments z = x + yi,
the formula |
||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (asinh z) | |||||||||
Parameters |
|
|||||||||
Description | asinh computes the hyperbolic arc sine
of z.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | LispMe extension | |||||||||
Examples |
|
Category | Library procedures | ||||||||||||
Formats |
|
||||||||||||
Parameters |
|
||||||||||||
Description | These procedures return the first element in alist, whose car is obj. If none is found, #f is returned. To compare obj with the keys, assoc uses equal?, assq uses eq?, and assv uses eqv?. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | ||||||||||||
Format |
|
||||||||||||
Parameters |
|
||||||||||||
Description | atan computes the arc tangent
of z in radians.
For complex arguments z = x + yi,
the formula With the second form, the result is an angle whose tangent is y/x, but the signs of the arguments decide which of the two angles differing by pi is returned. It's the same value as (angle (make-rectangular x y)) |
||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (atanh z) | |||||||||
Parameters |
|
|||||||||
Description | atanh computes the hyperbolic arc tangent
of z.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | LispMe extension | |||||||||
Examples |
|
Category | Special form | |||
Format | (begin expr1 expr2 ...) | |||
Parameters |
|
|||
Description | begin evaluates each expri in sequence
from left to right. The value of the last
expri is returned. A second use of begin is to group mutually recursive define expressions entered into the command line. | |||
R4RS Compliance | Full | |||
Examples |
|
Category | Primitive procedure | |||||||||||||||
Format | (bit-and ni ...) | |||||||||||||||
Parameters |
|
|||||||||||||||
Description | bit-and ands the bit pattern of any number of
integer numbers. The arguments are interpreted as
signed 15 bit integers. The truth table for this operation is
|
|||||||||||||||
R4RS Compliance | LispMe extension | |||||||||||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (bit-not n) | ||||||
Parameters |
|
||||||
Description | bit-not inverts every bit in its argument. The
result is returned as a
signed 15 bit integers. The truth table for this operation is
|
||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Primitive procedure | |||||||||||||||
Format | (bit-or ni ...) | |||||||||||||||
Parameters |
|
|||||||||||||||
Description | bit-or inclusively ors the bit pattern of any number of
integer numbers. The arguments are interpreted as
signed 15 bit integers. The truth table for this operation is
|
|||||||||||||||
R4RS Compliance | LispMe extension | |||||||||||||||
Examples |
|
Category | Primitive procedure | ||||||||||||||||||
Format | (bit-shift n k) | ||||||||||||||||||
Parameters |
|
||||||||||||||||||
Description | bit-shift shifts n by
k bits to the left (if k is
positive) or to the right (if k is negative).
All shifts are signed, i.e. they preserve the most significant
bit in the standard two's-complement representation of integers. Shift amounts are interpreted modulo 64, since 68000 family processors treat them this way. |
||||||||||||||||||
R4RS Compliance | LispMe extension | ||||||||||||||||||
Examples |
|
Category | Primitive procedure | |||||||||||||||
Format | (bit-xor ni ...) | |||||||||||||||
Parameters |
|
|||||||||||||||
Description | bit-xor exclusively ors the bit pattern of any number of
integer numbers. The arguments are interpreted as
signed 15 bit integers. The truth table for this operation is
|
|||||||||||||||
R4RS Compliance | LispMe extension | |||||||||||||||
Examples |
|
Category | Primitive procedure | |||
Format | (bitmap bmap) | |||
Parameters |
|
|||
Description | bitmap draws a bitmap at the current point stored in
*gstate* extending
to the right and the bottom. The current point is not changed.
The return value is #n to
avoid trashing the graphics. See here for details on the graphic state. The string describing the bitmap uses the standard Pilot bitmap format adn supports colored and multiple bitmaps (OS 3.5), It's exactly the format stored in a bitmap resource (ResType Tbmp). This format corresponds to this C structure definition (from the 3.5 header Core/System/Bitmap.h) typedef struct BitmapFlagsType { UInt16 compressed:1; // Data format: 0=raw; 1=compressed UInt16 hasColorTable:1; // if true, color table stored before bits[] UInt16 hasTransparency:1; // true if transparency is used UInt16 indirect:1; // true if bits are stored indirectly UInt16 forScreen:1; // system use only UInt16 reserved:11; } BitmapFlagsType; typedef struct BitmapType { Int16 width; Int16 height; UInt16 rowBytes; BitmapFlagsType flags; UInt8 pixelSize; // bits/pixel UInt8 version; // version of bitmap. This is vers 2 UInt16 nextDepthOffset; // # of DWords to next BitmapType // from beginnning of this one UInt8 transparentIndex; // v2 only, if flags.hasTransparency is true, // index number of transparent color UInt8 compressionType; // v2 only, if flags.compressed is true, this is // the type, see BitmapCompressionType UInt16 reserved; // for future use, must be zero! // [colorTableType] pixels | pixels* // If hasColorTable != 0, we have: // ColorTableType followed by pixels. // If hasColorTable == 0: // this is the start of the pixels // if indirect != 0 bits are stored indirectly. // the address of bits is stored here // In some cases the ColorTableType will // have 0 entries and be 2 bytes long. } BitmapType;Caution: The Pilot API is very sensitive to the right initialization of these fields, especially that rowBytes must be even. Though LispMe checks some of these conditions, an invalid bitmap can cause a Fatal exception, so you should stick to bitmaps read from resources and be careful when assembling bitmaps on the fly. You can retrieve the width and height of a bitmap with (define (width bitmap) (+ (* 256 (char->integer (string-ref bitmap 0))) (char->integer (string-ref bitmap 1)))) (define (height bitmap) (+ (* 256 (char->integer (string-ref bitmap 2))) (char->integer (string-ref bitmap 3))))As most bitmaps are smaller than 256 pixels, you can ignore the high-order byte: (define (width bitmap) (char->integer (string-ref bitmap 1))) (define (height bitmap) (char->integer (string-ref bitmap 3))) |
|||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (boolean? obj) | ||||||||||||
Parameters |
|
||||||||||||
Description | boolean? returns #t for the boolean values #t and #f and returns #f for any other object. Remember that in LispMe () and #f are distinct objects. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedures | |||||||||
Format | (c...r pair) | |||||||||
Parameters |
|
|||||||||
Description | c...r applies a sequence of car and cdr procedures to pair and returns the result. The ... may be any combination of upto 13 (!) a or d, where an a corresponds to car and a d corresponds to cdr. (cx...r pair) is equivalent to (cxr (c...r pair)), where each x is either a or d. | |||||||||
R4RS Compliance | Supports upto 13 nested applications instead of 4 | |||||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (call/cc procedure) | ||||||
Parameters |
|
||||||
Description | call/cc calls procedure with the
current continuation as its argument. The current continuation
is a special procedure (recognized by
continuation?)
of one argument and represents the remainder of the computation
from the call/cc-application. The continuation may
be called at any time later with any argument, which will be
the result of the call/cc-application. This may
happen several times, as the continuation has unlimited extent
like any other LispMe object, even when call/cc has
returned once. If the continuation is not called, the value returned by procedure is the value of this call/cc-application. |
||||||
R4RS Compliance | The verbose name call-with-current-continuation is not supported, you probably don't want to write this with Graffiti! | ||||||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (car pair) | ||||||||||||
Parameters |
|
||||||||||||
Description | car returns the car component of pair. The car component is the first argument given in the cons procedure. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Special form | ||||||
Format | (case expr (guard expr1 expr2 ...) ...) | ||||||
Parameters |
|
||||||
Description | case first evaluates expr and tests
sequentially, if its value is (using
eqv?) in one of
the constant lists guard.
When the first match is encountered,
its corresponding expri are evaluated from
left to right and the value of the last
expri is returned. Note that the constant lists must not be quoted! The special keyword else can be used for an "otherwise" clause. It's an error, if no guard matches. |
||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (cdr pair) | ||||||||||||
Parameters |
|
||||||||||||
Description | cdr returns the cdr component of pair. The cdr component is the second argument given in the cons procedure. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | ||||||
Format | (ceiling num) | ||||||
Parameters |
|
||||||
Description | ceiling converts num to a floating point number and returns the smallest whole number greater than or equal to num. The result is not a LispMe integer, it's a floating point value | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | ||||||
Format | (char->integer char) | ||||||
Parameters |
|
||||||
Description | char->integer returns the ASCII code of char. You should use a tool like AsciiChart to see characters and their codes on your Pilot. | ||||||
R4RS Compliance | Full | ||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (char? obj) | |||||||||
Parameters |
|
|||||||||
Description | char? returns #t for a character and #f for any other object. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (complex? obj) | ||||||||||||
Parameters |
|
||||||||||||
Description | complex? returns #t for integer, real and complex numbers and #f for any other object. In fact, it's the same procedure as number? | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Special form | |||||||||
Format | (cond (guard expr1 expr2 ...) ...) | |||||||||
Parameters |
|
|||||||||
Description | cond evaluates each guard in sequence.
When the first true guard is encountered,
its corresponding expri are evaluated from
left to right and the value of the last
expri is returned. The special keyword else, which is always true, can be used for an "otherwise" clause. It's an error, if no guard is true. |
|||||||||
R4RS Compliance | Expression sequence in each clause must not be empty | |||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (cons obj1 obj2) | |||||||||
Parameters |
|
|||||||||
Description | cons returns a freshly allocated pair whose car component is obj1 and whose cdr component is obj2. The new pair is always unique, i.e. it is not eq? to any other object. The procedures car and cdr are used to access the components of the pair. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (continuation? obj) | |||||||||
Parameters |
|
|||||||||
Description | continuation? returns #t for a continuation created with call/cc and #f for any other object. | |||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (cos z) | |||||||||
Parameters |
|
|||||||||
Description | cos computes the cosine of the number z.
z is an angle measured in radians.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | Full | |||||||||
Examples |
|
Category | Primitive procedure (MathLib required) | |||||||||
Format | (cosh z) | |||||||||
Parameters |
|
|||||||||
Description | cosh computes the hyperbolic cosine of the number
z.
For complex arguments z = x + yi,
the formula |
|||||||||
R4RS Compliance | LispMe extension | |||||||||
Examples |
|
Category | UI event | ||
Format | (ctl-enter id) | ||
Parameters |
|
||
Description | ctl-enter is the event posted when the user has tapped a control but not yet lifted the pen. |
Category | Primitive procedure | |||
Format | (ctl-get-val id) | |||
Parameters |
|
|||
Description | ctl-get-val returns the value of a control with id id as a boolean. This function makes only sense for pushbuttons or checkboxes. | |||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | UI event | ||
Format | (ctl-repeat id) | ||
Parameters |
|
||
Description | ctl-repeat is posted each time a repeating button control triggers while the user is holding the pen down. You should return #f from your event handler to make this work correctly. |
Category | UI event | ||||
Format | (ctl-select id state) | ||||
Parameters |
|
||||
Description | ctl-selected is the event posted when the user has tapped a control and released it. |
Category | Primitive procedure | ||||
Format | (ctl-set-val id obj) | ||||
Parameters |
|
||||
Description | ctl-set-val sets the value of a control with id id to obj where #f means off and any other value on. This function makes only sense for pushbuttons or checkboxes. The return value is obj. | ||||
R4RS Compliance | LispMe extension | ||||
Examples |
|
Catalog of Language Elements D - L