From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Dion via General Guile related discussions Newsgroups: gmane.lisp.guile.user Subject: Re: Question about an error with ports Date: Fri, 11 Mar 2022 10:06:09 -0500 Message-ID: <87a6dwbkbi.fsf@laura> References: <3f938fe1-9af4-9076-8d50-d1f7b2ddda36@posteo.de> <87ilslc0gn.fsf@laura> <87fsnpbcbp.fsf@laura> Reply-To: Olivier Dion Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26674"; mail-complaints-to="usenet@ciao.gmane.io" To: Maxime Devos , Zelphir Kaltstahl , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Mar 11 16:06:38 2022 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 1nSgqj-0006ip-Jj for guile-user@m.gmane-mx.org; Fri, 11 Mar 2022 16:06:37 +0100 Original-Received: from localhost ([::1]:45960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSgqi-00048v-Da for guile-user@m.gmane-mx.org; Fri, 11 Mar 2022 10:06:36 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSgqX-00048U-2E for guile-user@gnu.org; Fri, 11 Mar 2022 10:06:25 -0500 Original-Received: from smtp.polymtl.ca ([132.207.4.11]:34375) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSgqU-0005mk-9D for guile-user@gnu.org; Fri, 11 Mar 2022 10:06:23 -0500 Original-Received: from localhost (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 22BF69gt011807 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Mar 2022 10:06:14 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 22BF69gt011807 In-Reply-To: X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Fri, 11 Mar 2022 15:06:09 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 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:18186 Archived-At: On Fri, 11 Mar 2022, Maxime Devos wrote: > Olivier Dion via General Guile related discussions schreef op do 10-03- > 2022 om 18:46 [-0500]: >> I haven't check the implementation details, but I think it's just a >> question of buffering.=C2=A0 `get-bytevector-n` will block just like >> `get-bytevector-some` when the port is empty.=C2=A0 The former will retu= rn up >> to N bytes and the latter might return more than N bytes. > > I don't think that get-bytevector-some can return more, and it could > return less: > > Return either [...] or a new bytevector containing some of the > available bytes (at least one), More or less is relative to the N value compared with get-bytevector-n. So realy the `some` value is unknown. You just know you will have at least a byte yes. > Also, gnunet-scheme depends on the behaviour of it (*) being able to > return less without blocking (in gnu/gnunet/utils/tokeniser.scm). If > the behaviour was different, there would have been many test failures. > > (*) actually, it uses the variant 'get-bytevector-some!' instead of > 'get-bytevector-some'. Re-using the same vector would certainly reduce memory usage/fragmentation I suppose. Internally, the latter use the former I think. Regards, old --=20 Olivier Dion Polymtl