[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Stray Birds
I haven't used the HL macros, but what is wrong with the following
(besides "exporting" define-values-helper) as a _reference_
implementation
(define-syntax DEFINE-VALUES
(syntax-rules
()
((define-values (<name> ...) <body> ...)
(begin
(define <name> #f) ...
(call-with-values
(lambda () <body> ...)
(lambda all-the-values
(define-values-helper all-the-values <name> ...)))))))
(define-syntax DEFINE-VALUES-HELPER
(syntax-rules
()
((define-values-helper accum)
#f)
((define-values-helper accum <name1> <name2> ...)
(begin
(set! <name1> (car accum))
(define-values-helper (cdr accum) <name2> ...)))))