From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Llorens Newsgroups: gmane.lisp.guile.devel Subject: Re: `bytevector-length' doesn't accept a shared array from a bytevector Date: Tue, 21 Feb 2017 15:18:08 +0100 Message-ID: <877B3F28-97FF-4B82-86BD-F6860C768131@bluewin.ch> References: <87poib65oc.fsf@riseup.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1487689479 30997 195.159.176.226 (21 Feb 2017 15:04:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2017 15:04:39 +0000 (UTC) Cc: guile-devel@gnu.org To: "Diogo F. S. Ramos" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 21 16:04:31 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgBzJ-0006yU-Sb for guile-devel@m.gmane.org; Tue, 21 Feb 2017 16:04:22 +0100 Original-Received: from localhost ([::1]:46140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgBzP-00056b-Ht for guile-devel@m.gmane.org; Tue, 21 Feb 2017 10:04:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgBGk-0003TI-RJ for guile-devel@gnu.org; Tue, 21 Feb 2017 09:18:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgBGe-00057N-Gr for guile-devel@gnu.org; Tue, 21 Feb 2017 09:18:18 -0500 Original-Received: from vimdzmsp-sfwd01.bluewin.ch ([195.186.120.131]:43798 helo=smtpauths.lb.bluewin.ch) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cgBGe-00056j-9m for guile-devel@gnu.org; Tue, 21 Feb 2017 09:18:12 -0500 Original-Received: from 4box.hq.corp.viasat.com ([213.193.80.99]) by vimdzmsp-sfwd01.bluewin.ch Swisscom AG with SMTP id gBGac4cseHSN5gBGacHVPz; Tue, 21 Feb 2017 15:18:09 +0100 X-Bluewin-Spam-Analysis: v=2.1 cv=A6jMR/iG c=1 sm=1 tr=0 a=DzaHVtLsrNCQ5PccsnG91A==:117 a=DzaHVtLsrNCQ5PccsnG91A==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=bBqXziUQAAAA:8 a=rVkL8ZdBm1GYzU4w1WgA:9 a=rgjYxjB4ae0EZUhN:21 a=VtYu5slQ5htL4WsP:21 a=CjuIK1q_8ugA:10 a=BjKv_IHbNJvPKzgot4uq:22 X-Bluewin-Spam-Score: 0.00 X-FXIT-IP: IPv4[213.193.80.99] Epoch[1487686689] X-Bluewin-AuthAs: dll@bluewin.ch In-Reply-To: <87poib65oc.fsf@riseup.net> X-Mailer: Apple Mail (2.1878.6) X-CMAE-Envelope: MS4wfOAZu4E52z57ynP5oAEGSGpx/jNR9KOWMjck7HFBN/VeXPvAzupcxR0U0qhSQ/+gnNM1N0QdaqsaqeK3IOoNsvBVM37JxMyT2FtKVTiKPLLedRCkJnjD dRk+kgdOyqePKLHFsTpnpb2/DuP0NwZzfFRxaQXTah5pRSMYXUi1Mq/4zQf3vvi63lsbjbkNIJSZdD4AzCyX1eQgvP3sBZpOxnc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.186.120.131 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:18932 Archived-At: On 21 Feb 2017, at 14:21, Diogo F. S. Ramos wrote: > I want to take the length of a shared array, but `bytevector-length' > throws an error claiming the shared array isn't a bytevector, even > though it prints the error argument as one. >=20 > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> ,use (rnrs bytevectors) > scheme@(guile-user)> (bytevector-length=20 > (make-shared-array (make-bytevector 42) > list > 7)) > ERROR: In procedure bytevector-length: > ERROR: In procedure scm_c_bytevector_length: Wrong type argument in = position 1 (expecting bytevector): #vu8(0 0 0 0 0 0 0) >=20 > Entering a new prompt. Type `,bt' for a backtrace or `,q' to = continue. > scheme@(guile-user) [1]> > --8<---------------cut here---------------end--------------->8--- >=20 > I am using Guile 2.0.11, Debian Stable package 2.0.11+1-9. >=20 This is addressed in 2.1, by eb3d623da57e6d31a58d95f932345fb761f9b701. = Your example will print #1vu8(0 0 ...) to signify that it's not a = bytevector. You can use array-length here. I suppose the patch could be applied to 2.0.