1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +02:00

Finish call-with-port cleanup

* module/rnrs/io/ports.scm (call-with-port): Remove local definition.
* module/system/repl/server.scm (system): Call-with-port is imported
  via (ice-9 ports).
This commit is contained in:
Andy Wingo 2021-01-12 12:17:55 +01:00
parent 0f42fef119
commit 1820ed5121
2 changed files with 1 additions and 11 deletions

View file

@ -331,15 +331,6 @@ read from/written to in @var{port}."
(and (false-if-exception (set-port-position! port (port-position port))) (and (false-if-exception (set-port-position! port (port-position port)))
#t)) #t))
(define (call-with-port port proc)
"Call @var{proc}, passing it @var{port} and closing @var{port} upon exit of
@var{proc}. Return the return values of @var{proc}."
(call-with-values
(lambda () (proc port))
(lambda vals
(close-port port)
(apply values vals))))
(define* (call-with-bytevector-output-port proc #:optional (transcoder #f)) (define* (call-with-bytevector-output-port proc #:optional (transcoder #f))
(receive (port extract) (open-bytevector-output-port transcoder) (receive (port extract) (open-bytevector-output-port transcoder)
(call-with-port port proc) (call-with-port port proc)

View file

@ -1,6 +1,6 @@
;;; Repl server ;;; Repl server
;; Copyright (C) 2003, 2010, 2011, 2014, 2016, 2019 Free Software Foundation, Inc. ;; Copyright (C) 2003,2010,2011,2014,2016,2019,2021 Free Software Foundation, Inc.
;; This library is free software; you can redistribute it and/or ;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public ;; modify it under the terms of the GNU Lesser General Public
@ -27,7 +27,6 @@
#:use-module (ice-9 iconv) #:use-module (ice-9 iconv)
#:use-module (rnrs bytevectors) #:use-module (rnrs bytevectors)
#:use-module (ice-9 binary-ports) #:use-module (ice-9 binary-ports)
#:use-module ((rnrs io ports) #:select (call-with-port))
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-26) ; cut #:use-module (srfi srfi-26) ; cut
#:export (make-tcp-server-socket #:export (make-tcp-server-socket