Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.4 #24

Open
INotWant opened this issue Feb 25, 2020 · 0 comments
Open

4.4 #24

INotWant opened this issue Feb 25, 2020 · 0 comments

Comments

@INotWant
Copy link

(define (eval-or exp env)
  (if (null? exp)
    true
    (or (eval (car exp) env)
        (eval-or (cdr exp) env))))

应该为

(define (eval-or exp env)
  (if (null? exp)
    false
    (or (eval (car exp) env)
        (eval-or (cdr exp) env))))

后面实现为派生表达式,我认为应该为

(define (eval-and exp env)
    (make-if (null? exp)
        true
        (make-if (car exp)
            (eval-add (cdr exp) env)
            false)))

但是,我感觉用派生表示式的话,就没有短路效果了!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant