Experimental stub for call-with-values

This commit is contained in:
Justin Ethier 2015-06-04 22:20:26 -04:00
parent 01d388f7bf
commit 5c82cd7aef

View file

@ -133,13 +133,18 @@
(set! globals (cons 'call/cc globals)) (set! globals (cons 'call/cc globals))
(set! module-globals (cons 'call/cc module-globals)) (set! module-globals (cons 'call/cc module-globals))
(set! input-program (set! input-program
;(cons
; '(define call-with-values
; (lambda (k producer consumer)
; (producer
; )
(cons (cons
;; call/cc must be written in CPS form, so it is added here ;; 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
(lambda (k f) (f k (lambda (_ result) (k result))))) (lambda (k f) (f k (lambda (_ result) (k result)))))
cps))) cps)));)
(else (else
;; No need for call/cc yet ;; No need for call/cc yet
(set! input-program cps)))) (set! input-program cps))))