Removed dead code

This commit is contained in:
Justin Ethier 2015-03-23 22:35:47 -04:00
parent e73155586f
commit eae579bf32
2 changed files with 2 additions and 16 deletions

View file

@ -69,7 +69,7 @@
(set! globals (cons 'call/cc globals))
(set! input-program
(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: will this cause issues if another var is assigned to call/cc?
'(define call/cc

View file

@ -1462,21 +1462,7 @@
(cps ast
(let ((r (gensym 'r)))
`(lambda (,r) (%halt ,r)))))))
;; TODO: this is very broken if call/cc is used by a global function!!!
;; 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;)
))
ast-cps))
;; Closure-conversion.
;;