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.

THE TIME IS NOW 2/16 1139.8FUNCTION APPLY (F, X, P ) HAS BEEN ENTERED, ARGUMENTS. .COLLAPSE((((((A>,B>,C>,D>,E>)END OF APPLY, VALUE IS ...(A,B,c,D,E)he FIN card is read and the run terminates].(2) Function to Reverse a ListTwo different functions are shown which purport to reverselists, but only the second definition is correct.First DefinitionSecond DefinitionCrvde 6 a] = rev[ 1; NIL]rev[j;kl = [null[j]k;T+ rev[cdr[j];cons[car[j];k]]]To show the effect of these two definitions on a givenlist the following cards were punched and run:

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

Saved successfully!

Ooh no, something went wrong!