mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
WIP
This commit is contained in:
parent
506452654f
commit
68e91f2408
2 changed files with 18 additions and 1 deletions
|
@ -929,7 +929,9 @@
|
|||
(and
|
||||
arg ;; #f is a special value for init, so do not optimize it for now
|
||||
(or (const? arg)
|
||||
(quote? arg))))
|
||||
(quote? arg)
|
||||
(ref? arg)
|
||||
)))
|
||||
(cdr exp))
|
||||
)
|
||||
;; Check for primitive calls that can be optimized out
|
||||
|
|
|
@ -223,6 +223,21 @@
|
|||
set2
|
||||
(insert (car set1) (union (cdr set1) set2))))
|
||||
|
||||
;(define (union x y)
|
||||
; (let ((result (my-union x y)))
|
||||
; (trace:error `(union ,x ,y ,result ,(old-union x y)))
|
||||
; result))
|
||||
;
|
||||
;(define my-union
|
||||
; (lambda (l1 l2)
|
||||
; (if (null? l1)
|
||||
; l2 ;; TODO: sort l2 (or figure out why we get passed an unsorted list
|
||||
; (if (null? l2)
|
||||
; l1 ;; TODO: sort l1
|
||||
; (if (symbol<? (car l1) (car l2))
|
||||
; (cons (car l1) (my-union (cdr l1) l2))
|
||||
; (cons (car l2) (my-union (cdr l2) l1)))))))
|
||||
|
||||
; difference : sorted-set[symbol] sorted-set[symbol] -> sorted-set[symbol]
|
||||
(define (difference set1 set2)
|
||||
; NOTE: This can be similarly optimized.
|
||||
|
|
Loading…
Add table
Reference in a new issue