From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.devel Subject: Re: make-c-struct and pointer->string Date: Thu, 28 Mar 2019 12:48:25 -0300 Message-ID: <20190328124825.1da7d371@capac> References: <20190326101419.340081fc@capac> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/FPcJ2UpDlLhsIU=yZ5aeeoJ"; protocol="application/pgp-signature" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="115521"; mail-complaints-to="usenet@blaine.gmane.org" Cc: guile-devel To: Amirouche Boubekki Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 28 16:49:01 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9XH2-000TqG-9E for guile-devel@m.gmane.org; Thu, 28 Mar 2019 16:49:00 +0100 Original-Received: from localhost ([127.0.0.1]:38279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9XH1-0006xb-9S for guile-devel@m.gmane.org; Thu, 28 Mar 2019 11:48:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9XGi-0006xW-TP for guile-devel@gnu.org; Thu, 28 Mar 2019 11:48:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9XGh-0001fJ-JC for guile-devel@gnu.org; Thu, 28 Mar 2019 11:48:40 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:59998) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9XGh-0001el-6v for guile-devel@gnu.org; Thu, 28 Mar 2019 11:48:39 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 36E671BE00DD; Thu, 28 Mar 2019 16:48:36 +0100 (CET) Original-Received: from maximusconfessor.all2all.org ([127.0.0.1]) by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C-_SPe6DG7tv; Thu, 28 Mar 2019 16:48:36 +0100 (CET) Original-Received: from capac (unknown [179.210.18.152]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 7E87E1BE00D3; Thu, 28 Mar 2019 16:48:35 +0100 (CET) In-Reply-To: X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 79.99.200.102 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:19865 Archived-At: --Sig_/FPcJ2UpDlLhsIU=yZ5aeeoJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Amirouche, I should add to your own answer that you actually were unable to reproduce = the problem while using the latest 2.2 release tarball (the one that Ubuntu pac= kages to be (even) more precise), as one can see on your gnome paste earlier today [= 1] So, if this is corect, there must be a commit out there that 'broke it' Cheers, David here below, a copy/paste of https://paste.gnome.org/pbm5ok3pd#line-7 [ not sure how long gnome pastes remains visible .. [ in the paste below, which is not mine, I have no idea why, starting from [ line 15, guile entered a raised exception mode [1] amirouche =EE=82=B0 ~ =EE=82=B0 12:59:20 =EE=82=B0 guile GNU Guile 2.2.4 Copyright (C) 1995-2017 Free Software Foundation, Inc. =20 Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. =20 Enter `,help' for help. scheme@(guile-user)> (use-modules (system foreign)) scheme@(guile-user)> (define str-1 (string->pointer "Hello")) scheme@(guile-user)> (define str-2 (string->pointer "there!")) scheme@(guile-user)> (make-c-struct (list '* '*) (list str-1 str-2)) $1 =3D # scheme@(guile-user) [1]> (parse-c-struct $1 (list '* '*)) $2 =3D (# #) scheme@(guile-user) [1]> str-1 $3 =3D # scheme@(guile-user) [1]> (map pointer->string $2) $4 =3D ("Hello" "there!") scheme@(guile-user) [1]> (make-c-struct (list '* '*) (list (string->pointer= "hello ") (string->pointer "there!"))) $5 =3D # scheme@(guile-user) [1]> (parse-c-struct $5 (list '* '*)) $6 =3D (# #) scheme@(guile-user) [1]> (map pointer->string $6) $7 =3D ("hello " "there!") scheme@(guile-user) [1]> (make-c-struct (list '* '*) (list (string->pointer= "hello") (string->pointer "there!"))) $8 =3D # scheme@(guile-user) [1]> (parse-c-struct $8 (list '* '*)) $9 =3D (# #) scheme@(guile-user) [1]> (map pointer->string $9) $10 =3D ("hello" "there!") scheme@(guile-user) [1]> (make-c-struct (list '* '*) (list (string->pointer= "hello") (string->pointer "there!"))) $11 =3D # scheme@(guile-user) [1]> (parse-c-struct $11 (list '* '*)) $12 =3D (# #) scheme@(guile-user) [1]> (map pointer->string $12) $13 =3D ("hello" "there!") scheme@(guile-user) [1]> Posted by Anonymous at 28 Mar 2019, 12:33:15 UTC Language: scheme =E2=80=A2= Views: 4 =C2=A9 The GNOME Project GNOME Pastebin. Hosted by Red Hat. Powered by Sticky Notes =C2=A9 2014 Saya= k Banerjee. --Sig_/FPcJ2UpDlLhsIU=yZ5aeeoJ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAlyc7MkACgkQ83T9k6MF eteGigf8DfaancxF61uXCrFZzzxNodh0zqy+B/fdJN7lTvU3oQ3fJ9QcwIRRSB1q l06hMWRKFeo/zteWSGWcLJUOLukI+lrFlElCf7fFYKNFIX69gpOyPPstKC8xiC4z W/eJ+DnvTPVlf+MWIEtQcGKlR8kmHptGVsT4ITbe67jqE9OdnRpzv1SHWJqI4c6a x7sDvC6x237k36+3obUULm5h4C0nGCzAkJvsJ6zvGruz35d7rnGZn5pWf3BXXZNK 2TqlylAChNFpPa2maW9OoaiuUGNz2zmqpjshKYMbM2TTScrojhfFcsO1lLtg19kO v5PchdW0MMg9b9vIpMjquUcD4VOhCA== =dOuV -----END PGP SIGNATURE----- --Sig_/FPcJ2UpDlLhsIU=yZ5aeeoJ--