Lisp 1.5 - Running history
-
Upload
norman-richards -
Category
Software
-
view
125 -
download
2
Transcript of Lisp 1.5 - Running history
![Page 1: Lisp 1.5 - Running history](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/1.jpg)
(Lisp 1.5)
source: http://homepage.cs.uiowa.edu/~jones/cards/
---[ Norman Richards ]---
![Page 2: Lisp 1.5 - Running history](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/2.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/3.jpg)
LISP features• Computing with symbolic expressions
• Familiar FORTRAN-like syntax!
• Conditional expressions
• Recursion
• Garbage collection
• An interpreter
![Page 4: Lisp 1.5 - Running history](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/4.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/5.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/6.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/7.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/8.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/9.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/10.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/11.jpg)
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](https://reader034.fdocuments.net/reader034/viewer/2022042701/55aa3a8b1a28ab0f2a8b469f/html5/thumbnails/12.jpg)
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