[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/55: time: Support expressions that return any number
From: |
Andy Wingo |
Subject: |
[Guile-commits] 02/55: time: Support expressions that return any number of values. |
Date: |
Thu, 23 May 2019 11:52:36 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 24f45332b08c2041c71b61ea569c6ca8ea774677
Author: Ludovic Courtès <address@hidden>
Date: Sun Sep 23 16:27:32 2018 +0200
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 b693d61..7e3da84 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)))
- [Guile-commits] branch master updated (63de189 -> b94c5f8), Andy Wingo, 2019/05/23
- [Guile-commits] 01/55: time: Use 'syntax-rules' instead of 'define-macro'., Andy Wingo, 2019/05/23
- [Guile-commits] 03/55: time: Use #: for 'define-module' clauses., Andy Wingo, 2019/05/23
- [Guile-commits] 02/55: time: Support expressions that return any number of values.,
Andy Wingo <=
- [Guile-commits] 06/55: Fix 32/64 bit bug in INTEGER_ACCESSOR_PROLOGUE, Andy Wingo, 2019/05/23
- [Guile-commits] 10/55: Fix 'round-ash' of negative integers by huge right shift counts., Andy Wingo, 2019/05/23
- [Guile-commits] 12/55: Clarify the manual's "Processes" section., Andy Wingo, 2019/05/23
- [Guile-commits] 09/55: Gracefully handle huge shift counts in 'ash' and 'round-ash'., Andy Wingo, 2019/05/23
- [Guile-commits] 24/55: SRFI-19: time-utc->date: Support non-integer nanoseconds values., Andy Wingo, 2019/05/23
- [Guile-commits] 21/55: SRFI-19: Add a few more tests., Andy Wingo, 2019/05/23
- [Guile-commits] 11/55: In 'ash' and 'round-ash', handle right shift count of LONG_MIN., Andy Wingo, 2019/05/23
- [Guile-commits] 16/55: Add tests for type inferencing for 'nil?' and 'null?' predicates., Andy Wingo, 2019/05/23
- [Guile-commits] 22/55: SRFI-19: Fix normalization of seconds and nanoseconds in time records., Andy Wingo, 2019/05/23
- [Guile-commits] 20/55: SRFI-19: Fix handling of negative years and negative julian days., Andy Wingo, 2019/05/23