; WARNING TO ALL READERS OF ANY AGE: ; THIS WILL CATAPULT YOU INTO 1st GRADE. ; IT GOES ROUND AND ROUND ABOUT RECTANGLES ; ALL DAY LONG. -A RECTANGLE PARODY! ; Getting PROCEDURAL ; using definitions from the last time. ; (define make-vector cons) ; (define xcor car) ; (define ycor cdr) ; (define make-seg cons) ; (define seg-start car) ; (define seg-end cdr) (make-seg (make-vector 2 3) (make-vector 5 1)) ; That's now just a PAIR of PAIRS ; Introducing CLOSURE 3A:(5m47s) ; and Lisp's LISTS. 3A:(7m55s) (CONS 1 (CONS 2 (CONS 3 (CONS 4 NIL)))) ;meaning the same as (LIST 1 2 3 4) (DEFINE 1-TO-4 (LIST 1 2 3 4)) (CAR 1-TO-4) ;-> 1 (CAR (CDR 1-TO-4)) ;-> 2 (CAR (CDR (CDR 1-TO-4))) ;-> 3 ; 3A:(16m51s) Writing a LIST-PROCEDURE. (DEFINE (MAP P L) (IF (NULL? L) NIL (CONS (P (CAR L)) (MAP P (CDR L))))) ; then using the MAP-primitive to define ; (define (scale-list s l) ; (map (lambda (item) (*item s)) ; l)) ; ==> ABSTRACTION in MIND. ; 3A:(23m8s) Another form of LIST-PROCEDURE. ; ; (define (for-each proc list) ; (cond ((null? list) "done") ; (else (proc (car list)) ; (for-each proc ; (cdr list))))) ; ; QUESTIONS 3A:(24m57s) BREAK 3A:(28m23s) ; Henderson Escher Example ; summarizing the first two themes of the course. ; * List-Structure ; * Issues of Abstraction -> 1A:(18m) ; and Representation (Interfacing) -> 1A:(23m12s) ; * Capturing Commonality (Higher Order Procedures) ; introducing the third theme: ; * Metalinguistic Abstraction -> 1A:(24m41s) ; -> building syntactically complete new languages to more ; easily describe specific (complex) systems. ; ; Recapitulation on the topic in lecture 1A: ; What are the meters of a programming language? ; Its PRIMITIVES ; AND its MEANS OF COMBINATION ; AND its MEANS OF ABSTRACTION ; ; 3A:(30m12s) Peter Henderson's Program ; "I hope by the end of this morning, if you are not already, ; you will be completely confused about what the difference ; between procedures and data are." ; --Hal ; ; 1 PRIMITIVE 3A:(31m50s) ; PICTURE ; MEANS OF COMBINATION 3A:(33m17s) ; DEFINE, ROTATE, FLIP, BESIDE, ABOVE ; The primitive PICTURE is CLOSED (=> CLOSURE-PROPERTY) under the ; MEANS OF COMBINATION. ; Lisp Implementation Details... 3A:(38m) ; BREAK 3A:(48m28s) ; Why is it nice to do this THIS way? ; more implementation... Because the implementation is not anymore ; limited by the primitives but the imagination! ; 3A:(54m15s) get the CLOSURE-PROPERTY! ; MEANS OF ABSTRACTION 3A:(?m) ; kidding... ABSTRACTION comes with the MEANS OF COMBINATION and ; the ability to name this COMBINATION. ; To hide simplicity AND create complexity. ; implementation ... ; 3A:(1h7m5s) I am lost. ; 3A:(1h7m48s) Creating a Sequence of Layers of LANGUAGE. ; Language of SCHEMES of COMBINATION ; ; Creating Languages, not programs. ; ; ==> TALKING ABOUT CHANGE IN DIFFERENT WAYS ; (procedures as data, data as procedures, procedures defining the change) ; BREAK 3A:(1h14m43s) (END)