mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 20:45:06 +02:00
Removed dead code
This commit is contained in:
parent
e73155586f
commit
eae579bf32
2 changed files with 2 additions and 16 deletions
|
@ -69,7 +69,7 @@
|
||||||
(set! globals (cons 'call/cc globals))
|
(set! globals (cons 'call/cc globals))
|
||||||
(set! input-program
|
(set! input-program
|
||||||
(cons
|
(cons
|
||||||
;; Add call/cc here because it is already in CPS form
|
;; call/cc must be written in CPS form, so it is added here
|
||||||
;; TODO: prevents this from being optimized-out
|
;; TODO: prevents this from being optimized-out
|
||||||
;; TODO: will this cause issues if another var is assigned to call/cc?
|
;; TODO: will this cause issues if another var is assigned to call/cc?
|
||||||
'(define call/cc
|
'(define call/cc
|
||||||
|
|
16
trans.scm
16
trans.scm
|
@ -1462,21 +1462,7 @@
|
||||||
(cps ast
|
(cps ast
|
||||||
(let ((r (gensym 'r)))
|
(let ((r (gensym 'r)))
|
||||||
`(lambda (,r) (%halt ,r)))))))
|
`(lambda (,r) (%halt ,r)))))))
|
||||||
;; TODO: this is very broken if call/cc is used by a global function!!!
|
ast-cps))
|
||||||
;; TODO: if needed, should call/cc be added as a global?
|
|
||||||
;; may need a separate scanning phase to detect call/cc and add the def
|
|
||||||
;(if (member 'call/cc (free-vars ast))
|
|
||||||
; ; add this definition for call/cc if call/cc is needed
|
|
||||||
; (list
|
|
||||||
; (list
|
|
||||||
; 'lambda
|
|
||||||
; (list 'call/cc)
|
|
||||||
; ast-cps)
|
|
||||||
; '(lambda (k f)
|
|
||||||
; (f k (lambda (_ result) (k result)))))
|
|
||||||
ast-cps;)
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
;; Closure-conversion.
|
;; Closure-conversion.
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Reference in a new issue