mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Experimental stub for call-with-values
This commit is contained in:
parent
01d388f7bf
commit
5c82cd7aef
1 changed files with 6 additions and 1 deletions
|
@ -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))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue