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.

I IThe names cart1 and "cons1' will come to have mnemonic significanceonly when we discuss the representation of the systemin the computer. Compositions of - car and - cdr give the subexpressionsof a given expression in a given position. Compositionsof - cons form expressions of a given structure out of parts.The class of functions which can be formed in this way is quitelimited and not very interesting.d . Recursive S-f unc tionsWe get a much larger class of functions (in fact, all computablefunctions) when we allow ourselves to form new functionsof S-expressions by conditional expressions and recursive definition.We now give some examples of functions that are definablein this way.1. - ff[x]The value of ff [XI is the first atomic symbol of the S-expressionx with the parentheses ignored. Thusff[((A*B)*C)] = AWe haveff[x] = [atom[x] x;T + ff[car[x]]]We now trace in detail the steps in the evaluation offfC ((A*B)*c)I:

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

Saved successfully!

Ooh no, something went wrong!