Scheme language standardization process
On Sat 21 May 2011 06:59, Alex Shinn <alexshinn@x> writes:This is actually an incorrect program. If `expr' returns two values,
> (define-syntax time
> ((time expr)
> (let* ((start (current-time))
> (res expr))
> (report-time 'expr start (current-time))
> res)))
you want to return them to the continuation. You need:
(let ((start (current-time)))
(call-with-values (lambda () expr)
(lambda vals
(report-time 'expr start (current-time))(apply values vals))))
> Now, you may dislike these idioms, and argue in
> particular that the first doesn't work if expr returns
> multiple values, but it works fine for users who were
> not previously using MV in that context, or perhaps
> in any of their code. And using MV at all is still a
> contentious issue for some people. There's a
> difference between providing a feature, forcing
> people to use that feature in new code, and forcing
> them to rewrite their old code to support the feature.
> We debated this and voted strongly in favor of not
> breaking existing code.
_______________________________________________ Scheme-reports mailing list Scheme-reports@x http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports