Only in CS61A/Logo: Logo.patch diff -ru CS61A.orig/Logo/logo-meta.scm CS61A/Logo/logo-meta.scm --- CS61A.orig/Logo/logo-meta.scm Wed Dec 15 23:28:57 2021 +++ CS61A/Logo/logo-meta.scm Thu Dec 16 00:05:53 2021 @@ -318,7 +318,8 @@ ;; (add-prim 'setbg 1 (pcmd setbg)) ;; (add-prim 'setbackground 1 (pcmd setbg)) -(define exit-logo #f) +; (define exit-logo #f) +(define exit-logo (lambda () (exit 0))) (define back-to-top-level #f) (define the-global-environment '()) @@ -352,7 +353,7 @@ (helper)) (call-with-current-continuation (lambda (exit-cont) - (set! exit-logo exit-cont) + ; (set! exit-logo exit-cont) (call-with-current-continuation (lambda (top-level-cont) (set! back-to-top-level top-level-cont))) diff -ru CS61A.orig/Logo/logo.scm CS61A/Logo/logo.scm --- CS61A.orig/Logo/logo.scm Wed Dec 15 23:28:57 2021 +++ CS61A/Logo/logo.scm Thu Dec 16 01:24:01 2021 @@ -5,7 +5,7 @@ (define-class (line-obj line) (method (empty?) - (null? line)) + (or (eof-object? line) (null? line))) (method (next) (if (ask self 'empty?) (logo-error "Next called on empty line" self) @@ -419,7 +419,7 @@ (define (make-logo-arith op) (lambda args (apply op (map maybe-num args)))) -(define (maybe-num val) +(define (logo-maybe-num val) (if (word? val) (string->word (word->string val)) val)) Only in CS61A/Logo: macros.scm Only in CS61A/Logo: mylogo Only in CS61A/Logo: mylogo.scm diff -ru CS61A.orig/Logo/obj.scm CS61A/Logo/obj.scm --- CS61A.orig/Logo/obj.scm Wed Dec 15 23:28:57 2021 +++ CS61A/Logo/obj.scm Wed Dec 15 23:45:33 2021 @@ -65,37 +65,6 @@ (apply get-method (cons give-up-name (cons message (cdr objects)) )))))) - - -;; USUAL: Invoke a parent's method -;; Note: The 'send-usual-to-parent method is put in automatically by -;; define-class. - -(define-macro (usual . args) - `(ask dispatch 'send-usual-to-parent . ,args)) - -;; DEFINE-CLASS: Create a new class. - -; DEFINE-CLASS is a special form. When you type (define-class body...) -; it's as if you typed (make-definitions (quote body...)). In other -; words, the argument to DEFINE-CLASS isn't evaluated. This makes sense -; because the argument isn't Scheme syntax, but rather is the special -; object-oriented programming language we're defining. -; Make-definitions transforms the OOP notation into a standard Scheme -; expression, then uses EVAL to evaluate the result. (You'll see EVAL -; again in chapter 4 with the metacircular evaluator.) - -; When you define a class named THING, for example, two global Scheme -; variables are created. The variable THING has as its value the -; procedure that represents the class. This procedure is invoked by -; INSTANTIATE to create instances of the class. A second variable, -; THING-DEFINITION, has as its value the text of the Scheme expression -; that defines THING. This text is used only by SHOW-CLASS, the -; procedure that lets you examine the result of the OOP-to-Scheme -; translation process. - -(define-macro (define-class . body) (make-definitions body)) - (define (make-definitions form) (let ((definition (translate form))) (eval `(define ,(maknam (class-name form) '-definition) ',definition) @@ -277,3 +246,33 @@ ((pred (car l)) (cons (car l) (obj-filter (cdr l) pred))) (else (obj-filter (cdr l) pred)))) + +;; USUAL: Invoke a parent's method +;; Note: The 'send-usual-to-parent method is put in automatically by +;; define-class. + +; (define-macro (usual . args) +; `(ask dispatch 'send-usual-to-parent . ,args)) + +;; DEFINE-CLASS: Create a new class. + +; DEFINE-CLASS is a special form. When you type (define-class body...) +; it's as if you typed (make-definitions (quote body...)). In other +; words, the argument to DEFINE-CLASS isn't evaluated. This makes sense +; because the argument isn't Scheme syntax, but rather is the special +; object-oriented programming language we're defining. +; Make-definitions transforms the OOP notation into a standard Scheme +; expression, then uses EVAL to evaluate the result. (You'll see EVAL +; again in chapter 4 with the metacircular evaluator.) + +; When you define a class named THING, for example, two global Scheme +; variables are created. The variable THING has as its value the +; procedure that represents the class. This procedure is invoked by +; INSTANTIATE to create instances of the class. A second variable, +; THING-DEFINITION, has as its value the text of the Scheme expression +; that defines THING. This text is used only by SHOW-CLASS, the +; procedure that lets you examine the result of the OOP-to-Scheme +; translation process. + +; (define-macro (define-class . body) (make-definitions body)) + diff -ru CS61A.orig/Logo/simply.scm CS61A/Logo/simply.scm --- CS61A.orig/Logo/simply.scm Wed Dec 15 23:28:57 2021 +++ CS61A/Logo/simply.scm Thu Dec 16 00:19:08 2021 @@ -124,7 +124,7 @@ (string? string?) (string=? string=?)) (lambda (x) - (or (null? x) + (or (null? x) (and (string? x) (string=? x ""))))))