Mark H Weaver <[email protected]> skribis: > This patch implements 'define-values' as a macro, with a similar > implementation strategy to the one used in the sample definition given > in the R7RS. I hope to provide a more efficient implementation on the > master branch at some point -- one which does not involve any mutation > -- but for now I'd like to provide at least something so that code that > uses it will run on the upcoming Guile 2.0.10.
Sorry for the delay; looks good to me. Indeed it would be great to see in 2.2 if we can avoid walking the list of values. > + ((_ (var0 ... varn) expr) > + (and-map identifier? #'(var0 ... varn)) > + #`(begin > + (define dummy > + (call-with-values (lambda () expr) > + (case-lambda > + ((var0 ... varn) > + (list var0 ... varn)) > + (_ (%define-values-arity-error))))) Looks like this is precisely a case where top-level “hygiene” comes in handy, no? Thanks, Ludo’.
