make `merge-clause' a proper method

master
Moritz Heidkamp 14 years ago
parent 9fde24d7b5
commit e7e17baf47

@ -126,7 +126,10 @@
(cond ((null? ssql) (list clause)) (cond ((null? ssql) (list clause))
((before? (car clause) (caar ssql) order) ((before? (car clause) (caar ssql) order)
(cons clause ssql)) (cons clause ssql))
(else (cons (car ssql) (loop (cdr ssql)))))))))) (else (cons (car ssql) (loop (cdr ssql))))))))
((merge-clauses target-clause clause)
(append target-clause (cdr clause)))))
(define-operators *ansi-translator* (define-operators *ansi-translator*
(select prefix) (select prefix)
@ -265,9 +268,11 @@
(lambda (engine) (lambda (engine)
(cons (car ssql) (cons (car ssql)
(fold-right (lambda (clause ssql) (fold-right (lambda (clause ssql)
(let ((target (alist-ref (car clause) ssql))) (let ((target-clause (alist-ref (car clause) ssql)))
(if target (if target-clause
(alist-update! (car clause) (append target (cdr clause)) ssql) (alist-update! (car clause)
(engine 'merge-clauses target-clause clause)
ssql)
(engine 'insert-clause clause ssql)))) (engine 'insert-clause clause ssql))))
(cdr ssql) (cdr ssql)
clauses))))) clauses)))))

Loading…
Cancel
Save