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

Invalid indentation in eval.lisp #8

Open
phoe opened this issue Nov 21, 2020 · 0 comments
Open

Invalid indentation in eval.lisp #8

phoe opened this issue Nov 21, 2020 · 0 comments

Comments

@phoe
Copy link

phoe commented Nov 21, 2020

micromanual/eval.lisp

Lines 15 to 76 in ce48921

((eq (car e) (quote car))
(car (eval (cadr e) a)))
((eq (car e) (quote cdr))
(cdr (eval (cadr e) a)))
((eq (car e) (quote cadr))
(cadr (eval (cadr e) a)))
((eq (car e) (quote caddr))
(caddr (eval (cadr e) a)))
((eq (car e) (quote caar))
(caar (eval (cadr e) a)))
((eq (car e) (quote cadar))
(cadar (eval (cadr e) a)))
((eq (car e) (quote caddar))
(caddar (eval (cadr e) a)))
((eq (car e) (quote atom))
(atom (eval (cadr e) a)))
((eq (car e) (quote null))
(null (eval (cadr e) a)))
((eq (car e) (quote cons))
(cons (eval (cadr e) a) (eval (caddr e) a)))
((eq (car e) (quote eq))
(eq (eval (cadr e) a) (eval (caddr e) a)))
((eq (car e) (quote cond))
((label evcond
(lambda (u a)
(cond ((eval (caar u) a)
((eval (cadar u) a))
(t (evcond (cdr u) a)))))
(cdr e) a))
(t (eval (cons (cdr ((label assoc
(lambda (e a)
(cond
((null a) nil)
((eq e (caar a)) (car a))
(t (assoc e (cdr a))))))
(car e) a))
(cdr e))
a))))
((eq (caar e) (quote lambda))
(eval (caddar e)
((label ffappend
(lambda (u v)
(cond ((null u) v)
(t (cons (car u)
(ffappend (cdr u) v))))))
((label pairup
(lambda (u v)
(cond ((null u) nil)
(t (cons (cons (car u) (car v))
(pairup (cdr u) (cdr v)))))))
(label evlis
(lambda (u a)
(cond ((null u) nil)
(t (cons (eval (car u) a)
(evlis (cdr u) a))))))
(cdr e)
a))
a)))
((eq (caar e) (quote label))
(eval (cons (caddar e) (cdr e))) a)))))

Indentation is off in these cond forms; all forms belonging to a single cond case (meaning, test and the implicit progn afterwards) should have the same level of indentation.

The fix is to add spaces like this:

     ...
     ((eq (car e) (quote car)) 
      (car (eval (cadr e) a))) 
     ((eq (car e) (quote cdr)) 
      (cdr (eval (cadr e) a))) 
     ...

Should I submit a PR?

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