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.

eturn[fn[a]In terms of the M-type notation introduced in the previoussection this becomes:compiler program for search[~,p,fn,u] with programvariable at:at = LTEST [null[at] -+ -+ return[u];p[at]at = cdr[at]go [ TEST 1I]-In writing programs for the compiler the function setq mustbe used ---set is not acceptable.Amplification of the compiler system is under way. Inparticular a feature will be included to permit a user to writeSAP-type programs defining functions. Such programs will representa third way (in addition to EXPR and SUBR) of definingfunctions on their association lists, and should add flexibilityto the system. SAP-program definitions of functions w i l l betermed tMacros' and will be described in a later memo.Two examples of compiled functions are given below.1) memlis[x;y]The function memlis[x;y] is a predicate whose value is trueif x is a member of the list y, and false otherwise. x can bean atomic symbol or a list.In the program below the compiler has generated certainatomic symbols (~0005, G0006, G0008, ~0009) as location referencesin the program, and other symbols to be used as temporarystorage as indicated below.G0001) Index Register 4 at entry to memlis subroutineG0002) Storage for xG0003) Storage for yG0004) Storage for final answer (true or false)

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

Saved successfully!

Ooh no, something went wrong!