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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

When the APPLY operator evaluates a compound function, itdetermines first of all which of the three possible cases isinvolved.If the S-expression for a compound function begins withLAMBDA, the triplet for the APPLY operator will bef: (LAMBDA, (xi, x2, . . . , XN ) ,5 )X: (YI,Y~, . . . ,YN)P: (list of pairs)1The APPLY operator pairs the dummy variables , Xl,X2, ..., XN,with the values given on the list of arguments, x. If the twolists are not of the same length an error stop occurs. Otherwisethe list of pairs is added to the front of the p-list.Then the third element of the LAMBDA list, the form g for thefunction, is evaluated using the enlarged p-list of pairs ofassigned values.The form in the LAMBDA expression can be either anatomic symbol or a longer S-expression. The following casescan occur:5 = atomic symbol: The APPLY operator searches the associationlist of the atomic symbol to see if it represents a constant(signalled by either IAPVAL1 or 1APVALl1 on the associationlist--cf. Chapter 6), and if so the value of fis that constant. If the atomic symbol does not representa constant, the p-list is searched for the most recentpairing of this atomic symbol, and the value given by thispairing is the value of f. Otherwise an error is indicated,(see Chapter 8).AThe list of dummy variables can be the null list, ( ).

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

Saved successfully!

Ooh no, something went wrong!