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.

Since the program feature will be used frequently in themanual to describe <strong>LISP</strong> functions, and since M-expressions areeasier to read than S-expressions, programs will usually bewritten down in M-type notation. Program variables will begiven in lower case, but the atomic symbols used as locationmarkingsymbols will be retained in capital letters. The expression(SETQ,X;Y) becomes x = y.Using these rules and other obvious extensions of them the a-bove program is written as follows:program for search[a;p;fn;u] with program variables at:TESTCONTSTEPRETUat = ago[null[at] -* RETU;T -* CONT]go[p[at] -* RETF;T -* STEP]at = cdr[a]go [TEST]return[u]RE TF return[fn[a] ]4.6 The Com~ilerThe <strong>LISP</strong> compiler is itself a pseudo-function which isavailable to the APPLY operator. The compiler is called in bythe <strong>LISP</strong> function,where x is a list of names of the functions to be compiled.Each function on the list will be compiled into a binary ma-chine program provided the function is defined on its associationlist by an indicator EXPR pointing to an S-expression.

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

Saved successfully!

Ooh no, something went wrong!