[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/09: store: 'with-store' expands to a single procedure call.
From: |
guix-commits |
Subject: |
03/09: store: 'with-store' expands to a single procedure call. |
Date: |
Wed, 10 Apr 2019 06:41:09 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 95207e70d561517c8db8992f61552004f8213b04
Author: Ludovic Courtès <address@hidden>
Date: Tue Apr 9 09:52:48 2019 +0200
store: 'with-store' expands to a single procedure call.
* guix/store.scm (call-with-store): New procedure.
(with-store): Write in terms of 'call-with-store'.
---
guix/store.scm | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/guix/store.scm b/guix/store.scm
index 0a0a7c7..fdd04f3 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -602,19 +602,23 @@ connection. Use with care."
"Close the connection to SERVER."
(close (store-connection-socket server)))
-(define-syntax-rule (with-store store exp ...)
- "Bind STORE to an open connection to the store and evaluate EXPs;
-automatically close the store when the dynamic extent of EXP is left."
+(define (call-with-store proc)
+ "Call PROC with an open store connection."
(let ((store (open-connection)))
(dynamic-wind
(const #f)
(lambda ()
(parameterize ((current-store-protocol-version
(store-connection-version store)))
- exp) ...)
+ (proc store)))
(lambda ()
(false-if-exception (close-connection store))))))
+(define-syntax-rule (with-store store exp ...)
+ "Bind STORE to an open connection to the store and evaluate EXPs;
+automatically close the store when the dynamic extent of EXP is left."
+ (call-with-store (lambda (store) exp ...)))
+
(define current-store-protocol-version
;; Protocol version of the store currently used. XXX: This is a hack to
;; communicate the protocol version to the build output port. It's a hack
- branch master updated (6b11da7 -> 9e1e046), guix-commits, 2019/04/10
- 01/09: guix package: Use absolute file names in search path recommendations., guix-commits, 2019/04/10
- 02/09: doc: Adjust desktop instructions for GDM., guix-commits, 2019/04/10
- 05/09: ui: Fix i18n for diagnostic messages., guix-commits, 2019/04/10
- 09/09: ui: Colorize diagnostics., guix-commits, 2019/04/10
- 08/09: ui: Diagnostic procedures can display error location., guix-commits, 2019/04/10
- 04/09: Add (guix colors)., guix-commits, 2019/04/10
- 06/09: ui: Make diagnostic message prefix translatable., guix-commits, 2019/04/10
- 03/09: store: 'with-store' expands to a single procedure call.,
guix-commits <=
- 07/09: ui: Factorize 'print-diagnostic-prefix'., guix-commits, 2019/04/10