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.

Another pseudo-function, compile[^], is available to compilefunctions not previously defined, The argument of compileis a list of function definitions, each one of which must be ofthe form(LABEL~NAMB, (LAMBDA, (list of free variables), expression) )The functions - caar,cadr -9 oo.,cddar,cdddr are available tothe compiler, so it is possible to write simply (CADAR,~) inlieu of (CAR, (CDR, CAR,^))) in defining a function. If astring of Ass and Dgs of length greater than three is required,it is again necessary to form the function by composition, foeo(CDADR(CAR,X) ) f OP (CDADAR, X)The compiler will accept any function definition which isacceptable to the APPLY operator, except that the program featureis different insofar as the GO statement is concerned,For the compiler version of PROG the argument of any GO must bean atomic symbol; it cannot be a conditional expression. However,in distinction to the usual program-feature, conditionalstatements are themselves allowed as action statements by thecompiler provided they give rise to a definite action, e.g,~COND, (PI, (Go,A) 1, (~2,Furthermore, conditional expressions as used here do - not needto include a true (T) action. If none of the conditions aresatis.ffed, the next statement in the program following theconditional statement is executed.Thus the example of the PROG for search given in the previoussection must be revised for the compiler to the following(RETURN,X) 1, (P~,(SETQ,B~ (CAR,B)) 1)

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

Saved successfully!

Ooh no, something went wrong!