summaryrefslogtreecommitdiff
path: root/guix/inferior.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-07-12 01:03:53 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-07-12 01:03:53 +0200
commitfb9a23a3f3ad3d7b5b7f03b2007baf27684d6bbd (patch)
treeafbd3f4f33771c61254b0c3d977092542fbe8009 /guix/inferior.scm
parent1c4b72cb34640638e40c5190676e5c8c352d292d (diff)
parent5a836ce38c9c29e9c2bd306007347486b90c5064 (diff)
downloadguix-patches-fb9a23a3f3ad3d7b5b7f03b2007baf27684d6bbd.tar
guix-patches-fb9a23a3f3ad3d7b5b7f03b2007baf27684d6bbd.tar.gz
Merge branch 'master' into core-updates
Conflicts: gnu/local.mk gnu/packages/python-xyz.scm gnu/packages/xml.scm guix/gexp.scm po/guix/POTFILES.in
Diffstat (limited to 'guix/inferior.scm')
-rw-r--r--guix/inferior.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index 63c95141d7..fee97750b6 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -59,6 +59,7 @@
inferior-eval
inferior-eval-with-store
inferior-object?
+ read-repl-response
inferior-packages
inferior-available-packages
@@ -183,7 +184,8 @@ equivalent. Return #f if the inferior could not be launched."
(set-record-type-printer! <inferior-object> write-inferior-object)
-(define (read-inferior-response inferior)
+(define (read-repl-response port)
+ "Read a (guix repl) response from PORT and return it as a Scheme object."
(define sexp->object
(match-lambda
(('value value)
@@ -191,12 +193,15 @@ equivalent. Return #f if the inferior could not be launched."
(('non-self-quoting address string)
(inferior-object address string))))
- (match (read (inferior-socket inferior))
+ (match (read port)
(('values objects ...)
(apply values (map sexp->object objects)))
(('exception key objects ...)
(apply throw key (map sexp->object objects)))))
+(define (read-inferior-response inferior)
+ (read-repl-response (inferior-socket inferior)))
+
(define (send-inferior-request exp inferior)
(write exp (inferior-socket inferior))
(newline (inferior-socket inferior)))