Fix adjoin-term
The term passed in loses its tag on each call to apply-generic, so the term must be re-constructed.
This commit is contained in:
parent
f598b2c3f1
commit
8c12ac0e4c
10
2_78.rkt
10
2_78.rkt
|
@ -582,7 +582,13 @@
|
|||
(tag (rest-terms termlist))))
|
||||
(put 'empty-termlist? '(termlist) empty-termlist?)
|
||||
|
||||
(put 'adjoin-term '(term termlist) adjoin-term)
|
||||
;; Term will have its tag removed by apply-generic. This needs to be
|
||||
;; re-added for the next apply-generic call (needed to step into the
|
||||
;; appropriate termlist implementation).
|
||||
(put 'adjoin-term '(term termlist)
|
||||
(lambda (term termlist)
|
||||
(adjoin-term (apply make-term term)
|
||||
termlist)))
|
||||
|
||||
(put 'make-sparse-termlist 'termlist
|
||||
make-sparse)
|
||||
|
@ -621,7 +627,7 @@
|
|||
(lambda (terms) (tag (make-termlist terms))))
|
||||
(put 'adjoin-term '(term sparse)
|
||||
(lambda (term termlist)
|
||||
(tag (adjoin-term term termlist))))
|
||||
(tag (adjoin-term (apply make-term term) termlist))))
|
||||
(put 'empty-termlist? '(sparse) empty-termlist?)
|
||||
(put 'the-empty-termlist '(sparse)
|
||||
(lambda ()
|
||||
|
|
Loading…
Reference in New Issue