Woohoo!! Only got APPLY and EVAL yet to test!

This commit is contained in:
Simon Brooke 2019-08-17 10:21:08 +01:00
parent a0aa434933
commit b92a24c089
2 changed files with 10 additions and 1 deletions

View file

@ -198,7 +198,7 @@
See page 12 of the Lisp 1.5 Programmers Manual."
[a y]
(cond
(primitive-atom? y) (sub2 a y)
(= (primitive-atom? y) 'T) (sub2 a y)
:else
(make-cons-cell (sublis a (car y)) (sublis a (cdr y)))))

View file

@ -218,3 +218,12 @@
'D
(gsp "((A . (M N)) (B . (CAR X)) (C . (QUOTE M)) (C . (CDR X)))")))]
(is (= actual expected)))))
(deftest sublis-tests
(testing "sublis"
(let [expected "(SHAKESPEARE WROTE (THE TEMPEST))"
actual (print-str
(sublis
(gsp "((X . SHAKESPEARE) (Y . (THE TEMPEST)))")
(gsp "(X WROTE Y)")))]
(is (= actual expected)))))