Download ALisp v2 User's Guide

Transcript
The fields of a structure are updated and accessed using accessor functions generated for each field:
(S-FIELD S)
for example:
> (person-name p)
"Tore"
Fields are updated by combining SETF with an accessor function:
(SETF (S-FIELD S) VAL)
For example:
> (setf (person-name p) "Kalle")
"Kalle"
> (person-name p)
"Kalle"
An object O can be tested to be a structure of type S using the generated function:
(S-P O)
For example:
> (person-p p)
T
3.15.
Function
Miscellaneous functions
Type
Description
(ADVISE-AROUND FN CODE) LAMBDA Replace the body of function FN with form CODE where each * is
substituted for the original body of FN. (So called aspect-oriented
programming). CODE must be a single form. The variables of FN
are available in CODE. If the function is an EXTFN the variable
!ARGS is bound in CODE to a list of the actual arguments.
(CHECKEQUAL TEXT (FORM VALUE)...)
SPECIAL Regression testing facility. The TEXT is first printed. Then each
FORM is evaluated and its result compared with the value of the
evaluation of the corresponding VALUE. If some evaluation of
some FORM is not EQUAL to the corresponding VALUE an error
notice is printed.
(DECLARE ...)
*MACRO Dummy defined in ALisp for compatibility with CommonLisp.
(EVALLOOP)
EXTFN
Enter a Lisp top loop. Return to caller when function (EXIT) is
called.
(EXIT)
EXTFN
Return from the Lisp top loop to the program that called it. In a
stand-alone Amos II system EXIT is equivalent to QUIT. When
Amos II is embedded in some other system EXIT will pass the
control to the embedding system.
(ID X)
LAMBDA ID is the identity function.
(IMAGESIZE SIZE)
EXTFN
Extend the system’s database image size to SIZE. If SIZE = NIL the
31