From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Difference between pipes and ports Date: Wed, 11 Aug 2021 01:14:13 +0000 Message-ID: <1c1789ba-68af-66b7-445c-333f02d89392@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37648"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Aug 11 03:14:41 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDcpM-0009bP-R2 for guile-user@m.gmane-mx.org; Wed, 11 Aug 2021 03:14:40 +0200 Original-Received: from localhost ([::1]:55098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDcpL-0008Fx-0G for guile-user@m.gmane-mx.org; Tue, 10 Aug 2021 21:14:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDcp2-0008Fn-Kh for guile-user@gnu.org; Tue, 10 Aug 2021 21:14:22 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:37467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDcp0-0004dY-Iq for guile-user@gnu.org; Tue, 10 Aug 2021 21:14:20 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id C68BA240101 for ; Wed, 11 Aug 2021 03:14:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1628644454; bh=vU3eRO1NdacSUO5s0FtTdspe1ILn3+8x664RW5t0EWw=; h=To:From:Subject:Date:From; b=P9Lm6vqC8ABeY1xAXTT8RgpdWVD/XYrsxXpAtANThkIv3L1eHEtukyGoO7GxFKgJ3 vJnqcRMOMJ49gNlVi8oOLGp8Ee4vTUaNrhO8YikqLyjPBWCDfYdjV1uaHqyON5o81i c8TxjEAm3aYzwCTcWGpOjsQ1J7JTXiYRwyCto3iU42bcQRMWA3EpjOTlrLPVnBFPw3 Tg84of5BXpmFtsGAdvsvREvu2jsm+gyMRFMnm6AnsR6iBOXzMxhaE/4I9V16NrLWir N/RbAKSIFweuBCONM+x+EoNr+2yzWabO2jOe2HNqhqsPsnRERVRS9yvANWJl1MvHHY d0odxlt7Wlwtw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GksKf0Pl4z6tm4 for ; Wed, 11 Aug 2021 03:14:13 +0200 (CEST) Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=zelphirkaltstahl@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17678 Archived-At: Hello Guile users, I recently came across https://www.draketo.de/software/guile-capture-stdout-stderr.html and wrote a commented version at https://notabug.org/ZelphirKaltstahl/guile-examples/src/master/input-output/stdout-stderr.scm . While looking at the code, I was starting to wonder, what the difference between a pipe and a port is. The reference manual does not say much about any definition of what a pipe is at https://www.gnu.org/software/guile/manual/html_node/Pipes.html and pipe procedure return values are also named port. However, in the REPL, they look not the same: ~~~~ scheme@(guile-user)> (import (ice-9 popen)) scheme@(guile-user)> (open-input-pipe "ls -al") $2 = # ~~~~ And here for ports: ~~~~ scheme@(guile-user)> (call-with-output-string (λ (port) (display port))) #$6 = "" ~~~~ Is a pipe just a special kind of port? Does it wrap a port? Or is it perhaps merely a different terminology used in different contexts in the reference manual? Best regards, Zelphir -- repositories: https://notabug.org/ZelphirKaltstahl