From 24f45332b08c2041c71b61ea569c6ca8ea774677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 23 Sep 2018 16:27:32 +0200 Subject: [PATCH] time: Support expressions that return any number of values. * module/ice-9/time.scm (time-proc): Call PROC with 'call-with-values'; return all its values. --- module/ice-9/time.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/ice-9/time.scm b/module/ice-9/time.scm index b693d6126..7e3da849f 100644 --- a/module/ice-9/time.scm +++ b/module/ice-9/time.scm @@ -35,7 +35,7 @@ (define (time-proc proc) (let* ((gc-start (gc-run-time)) (tms-start (times)) - (result (proc)) + (results (call-with-values proc list)) (tms-end (times)) (gc-end (gc-run-time))) ;; FIXME: We would probably like format ~f to accept rationals, but @@ -50,7 +50,7 @@ (get tms:cutime tms-start tms-end) (get tms:cstime tms-start tms-end) (get identity gc-start gc-end)) - result)) + (apply values results))) (define-syntax-rule (time exp) (time-proc (lambda () exp)))