Woohoo!! Only got APPLY and EVAL yet to test!
This commit is contained in:
parent
a0aa434933
commit
b92a24c089
|
@ -198,7 +198,7 @@
|
||||||
See page 12 of the Lisp 1.5 Programmers Manual."
|
See page 12 of the Lisp 1.5 Programmers Manual."
|
||||||
[a y]
|
[a y]
|
||||||
(cond
|
(cond
|
||||||
(primitive-atom? y) (sub2 a y)
|
(= (primitive-atom? y) 'T) (sub2 a y)
|
||||||
:else
|
:else
|
||||||
(make-cons-cell (sublis a (car y)) (sublis a (cdr y)))))
|
(make-cons-cell (sublis a (car y)) (sublis a (cdr y)))))
|
||||||
|
|
||||||
|
|
|
@ -218,3 +218,12 @@
|
||||||
'D
|
'D
|
||||||
(gsp "((A . (M N)) (B . (CAR X)) (C . (QUOTE M)) (C . (CDR X)))")))]
|
(gsp "((A . (M N)) (B . (CAR X)) (C . (QUOTE M)) (C . (CDR X)))")))]
|
||||||
(is (= actual expected)))))
|
(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)))))
|
||||||
|
|
Loading…
Reference in a new issue