10.07.2015 Views

LISP I Programmer's Manual - Software Preservation Group

LISP I Programmer's Manual - Software Preservation Group

LISP I Programmer's Manual - Software Preservation Group

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Note that the argument x starts with three parentheses: thefirst parenthesis starts the list x, the second indicates thatx is a list of one argument, and the third starts the first pair.After APPLY has evaluated this triplet, the define function willhave put the respective definitions, labelled by EXPR, on theassociation lists of the atomic symbols FF and ALT. Of course,define itself is one of the functions already defined and availableas part of the <strong>LISP</strong> system.Incidentally, a function can be defined in terms of anotheralready-defined function--in which case the S-expression becomessimply the name of the established function. For examplesuppose one wishes to define the function FRST by the pair(FRST,CAR). After the define has been applied, the associationlist for FRST w i l l contain the structureCARwhere CAR points to the already-established association listfor CAR. Chains of definitions of this sort are perfectly legalin <strong>LISP</strong> I.The function define makes the use of label desirable onlywhen the labeled function is itself the result of a computationand is not to be put on an association list for storage reasons.4.3 Functions Appropriate to APPLYVarious kinds of functions can be used in <strong>LISP</strong> programming.One way of classifying functions is to divide them intofunctions and pseudo-functions, A function in <strong>LISP</strong> is evaluatedfor its value as such, e.g. car[ (A,B,C)] = A, whereas a pseudo-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!