mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 16:27:35 +02:00
WIP
This commit is contained in:
parent
10bfe42eff
commit
4ac97adb32
1 changed files with 7 additions and 2 deletions
|
@ -134,9 +134,9 @@ if (acc) {
|
||||||
(define inner-union
|
(define inner-union
|
||||||
(lambda (last l1 l2)
|
(lambda (last l1 l2)
|
||||||
(if (null? l1)
|
(if (null? l1)
|
||||||
l2 ;; TODO: sort l2 (or figure out why we get passed an unsorted list
|
(next last l2)
|
||||||
(if (null? l2)
|
(if (null? l2)
|
||||||
l1 ;; TODO: sort l1
|
(next last l1)
|
||||||
;; TODO: also have an eq? check to eliminate duplicates
|
;; TODO: also have an eq? check to eliminate duplicates
|
||||||
(if (symbol<? (car l1) (car l2))
|
(if (symbol<? (car l1) (car l2))
|
||||||
(if (eq? last (car l1))
|
(if (eq? last (car l1))
|
||||||
|
@ -146,6 +146,11 @@ if (acc) {
|
||||||
(inner-union last l1 (cdr l2))
|
(inner-union last l1 (cdr l2))
|
||||||
(cons (car l2) (inner-union (car l2) l1 (cdr l2)))))))))
|
(cons (car l2) (inner-union (car l2) l1 (cdr l2)))))))))
|
||||||
|
|
||||||
|
(define (next sym lis)
|
||||||
|
(if (and (pair? lis) (eq? sym (car lis)))
|
||||||
|
(next sym (cdr lis))
|
||||||
|
lis))
|
||||||
|
|
||||||
(write
|
(write
|
||||||
(union '(a b c) '(d e f)))
|
(union '(a b c) '(d e f)))
|
||||||
(newline)
|
(newline)
|
||||||
|
|
Loading…
Add table
Reference in a new issue