This commit is contained in:
Justin Ethier 2017-11-19 18:43:37 -05:00
parent 5acffd72d1
commit 8750696e17

View file

@ -530,19 +530,15 @@
(lambda (expr rename compare) (lambda (expr rename compare)
(apply error (cdr expr))))) (apply error (cdr expr)))))
;; TODO: The whitespace characters are space, tab, line feed, form feed (not in parser yet), and carriage return.
(define call-with-current-continuation call/cc) (define call-with-current-continuation call/cc)
;; TODO: this is from r7rs, but is not really good enough by itself
;(define (values . things) ;; Extended from r7rs definition to work in our Scheme
; (call/cc
; (lambda (cont) (apply cont things))))
(define values (define values
(lambda args (lambda args
(if (and (not (null? args)) (null? (cdr args))) (if (and (not (null? args)) (null? (cdr args)))
(car args) (car args)
(cons (cons 'multiple 'values) args)))) (cons (cons 'multiple 'values) args))))
;; TODO: just need something good enough for bootstrapping (for now)
;; does not have to be perfect (this is not, does not handle call/cc or exceptions)
(define call-with-values (define call-with-values
(lambda (producer consumer) (lambda (producer consumer)
(let ((x (producer))) (let ((x (producer)))