lisp 1.5 - running history

12
(Lisp 1.5) source: http://homepage.cs.uiowa.edu/~jones/cards/ ---[ Norman Richards ]---

Upload: norman-richards

Post on 18-Jul-2015

125 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Lisp 1.5 - Running history

(Lisp 1.5)

source: http://homepage.cs.uiowa.edu/~jones/cards/

---[ Norman Richards ]---

Page 2: Lisp 1.5 - Running history

Introducing LISP

search[x; p; f ; u] = [null[x] ! u; p[x] ! f [x]; T ! search[cdr[x]; p; f ; u] maplist[x; f] = [null[x] ! NIL; T ! cons[f[x]; maplist[cdr[x]; f]]]

Page 3: Lisp 1.5 - Running history

LISP features• Computing with symbolic expressions

• Familiar FORTRAN-like syntax!

• Conditional expressions

• Recursion

• Garbage collection

• An interpreter

Page 4: Lisp 1.5 - Running history

But ...

• LISP meta-language input is not yet available

• Need to hand translate MEXPR into SEXPR for code entry

Page 5: Lisp 1.5 - Running history

Things I learned about early LISP• S-Expressions were not intended for coding

• CAR/CDR represents parts of a word - there's no "decrement register"

• LISP wasn't about lambda calculus - it just needed a function notation

• Early LISP has dynamic scope (FUNARG problem)

• No macros - just FEXPRS

• Functional / pseudo-functional distinction, higher order functions

• Debugging through TRACE, COUNT, PRINT

• Apply was the "universal function" of the interpreter function eval

Page 6: Lisp 1.5 - Running history

The Big 5 to implement eval• ATOM - predicate is the argument an atom?

• EQ - are two atoms the same?

• CONS - construct a list with a given head/tail

• CAR - return the head of a list

• CDR - return the tail of a list

Page 7: Lisp 1.5 - Running history

Running LISP 1.5 Today• SIMH - a highly portable, multi-system simulator

• http://simh.trailing-edge.com/

• I'm using macports SIMH for this demo

• LISP 1.5 system- for IBM 7094

• http://www.sonoma.edu/users/l/luvisi/lisp/lisp15.tar.gz

Page 8: Lisp 1.5 - Running history

Running SIMH

simh-i7094 lisptape.ini program.txt

LISP system configuration

LISP input in overlord format

sys.log

Output "tape"

Page 9: Lisp 1.5 - Running history

LISP input TEST FACTORIAL

DEFINE (( (FACTORIAL (LAMBDA (X) (COND ((EQUAL X 0) 1) (T (TIMES X (FACTORIAL (SUB1 X))))))) ))

FACTORIAL (5)

STOP FIN

Page 10: Lisp 1.5 - Running history

Explaining the input• TEST/FIN are overlord controls

• STOP indicates the end of LISP commands

• LISP commands are a function and a list of arguments

• In Clojure, roughly: #(apply %1 %2)

• Translated to BCD and

Page 11: Lisp 1.5 - Running history

LISP Output

TEST FACTORIAL

THE TIME ( 0/ 0 000.0) HAS COME, THE WALRUS SAID, TO TALK OF MANY THI NGS ..... -LEWIS CARROLL- EVALQUOTE OPERATOR AS OF 1 MARCH 1961. INPUT LISTS NOW BEING READ.

THE TIME ( 0/ 0 000.0) HAS COME, THE WALRUS SAID, TO TALK OF MANY THI NGS ..... -LEWIS CARROLL- FUNCTION EVALQUOTE HAS BEEN ENTERED, ARGUMENTS.. DEFINE

(((FACTORIAL (LAMBDA (X) (COND ((EQUAL X 0) 1) (T (TIMES X (FACTORIAL ( SUB1 X)))))))))

END OF EVALQUOTE, VALUE IS .. *TRUE*

FUNCTION EVALQUOTE HAS BEEN ENTERED, ARGUMENTS.. FACTORIAL

(5)

END OF EVALQUOTE, VALUE IS .. 120

THE TIME ( 0/ 0 000.0) HAS COME, THE WALRUS SAID, TO TALK OF MANY THI NGS ..... -LEWIS CARROLL- END OF EVALQUOTE OPERATOR FIN

Page 12: Lisp 1.5 - Running history

References• Recursive Functions of Symbolic Expressions and Their

Computation by Machine, Part I

• http://www-formal.stanford.edu/jmc/recursive.pdf

• LISP 1.5 Programmer's Manual

• http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf

• History of Lisp

• http://www-formal.stanford.edu/jmc/history/lisp/lisp.html