From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mark.d.witmer@gmail.com Newsgroups: gmane.lisp.guile.user Subject: Re: asynchronous socket library Date: Sun, 25 Aug 2013 18:26:04 -0400 Message-ID: <87ppt1o1ab.fsf@gmail.com> References: <8761w9n2i6.fsf@mark-desktop.PK5001Z> <8738rd1wwy.fsf@tines.lan> <87a9ll9loc.fsf@markwitmer.com> <87d2p2bwq6.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1377412986 28877 80.91.229.3 (25 Aug 2013 06:43:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2013 06:43:06 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 25 08:43:08 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VDU2W-0007iP-49 for guile-user@m.gmane.org; Sun, 25 Aug 2013 08:43:08 +0200 Original-Received: from localhost ([::1]:45159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDU2V-00067Z-N1 for guile-user@m.gmane.org; Sun, 25 Aug 2013 02:43:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDMIZ-0003aG-Dx for guile-user@gnu.org; Sat, 24 Aug 2013 18:27:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDMIT-0000BG-7k for guile-user@gnu.org; Sat, 24 Aug 2013 18:27:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:38937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDMIT-0000BC-1D for guile-user@gnu.org; Sat, 24 Aug 2013 18:27:05 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VDMIR-0007rd-HW for guile-user@gnu.org; Sun, 25 Aug 2013 00:27:03 +0200 Original-Received: from cpe-184-58-115-186.woh.res.rr.com ([184.58.115.186]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Aug 2013 00:27:03 +0200 Original-Received: from mark.d.witmer by cpe-184-58-115-186.woh.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Aug 2013 00:27:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpe-184-58-115-186.woh.res.rr.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:gT7Lz/WieS+7Rnre3xgr3bQGnlo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-Mailman-Approved-At: Sun, 25 Aug 2013 02:42:53 -0400 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10688 Archived-At: Mark H Weaver writes: > > First of all, that '(close-port port)' is wrong. Here you are trying to > tell Guile how to close 'port', and this just recurses. I guess it > should be (close-port auth-file)'. That's right. It's two bugs, actually---closing the file would cause an infinite loop and I didn't catch it because I never actually closed the file! > > However, I don't see why this custom port is needed at all. You've > already opened 'auth-file' in binary mode, so you should be able to use > it directly, i.e. replace the above code with: > > (define port (open-file (getenv "XAUTHORITY") "rb")) > Ok, I finally get what you're saying... procedures like 'get-bytevector-n' or 'put-u8' and so forth work just fine on ports that are opened in binary mode---no custom binary ports needed! Reading the manual gave me the impression that there was a fundamental difference between file ports opened in binary mode as described in section 6.14.9.1, and R6RS binary input/output ports as described in sections 6.14.10.8 and 6.14.10.11. Now that you've explained it to me, it makes sense that procedures that call for the latter would work on the former as well. -- Mark Witmer