unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: David Pirotte <david@altosw.be>
To: Amirouche Boubekki <amirouche.boubekki@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: make-c-struct and pointer->string
Date: Thu, 28 Mar 2019 12:48:25 -0300	[thread overview]
Message-ID: <20190328124825.1da7d371@capac> (raw)
In-Reply-To: <CAL7_Mo_i8X6kddhsr0SxxEBo+cStOXnB4Sp30U5BHiw1TtveNA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2751 bytes --]

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 packages 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  ~  12:59:20  guile
GNU Guile 2.2.4
Copyright (C) 1995-2017 Free Software Foundation, Inc.
 
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.
 
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 = #<pointer 0x55f30df62dd0>
scheme@(guile-user) [1]> (parse-c-struct $1 (list '* '*))
$2 = (#<pointer 0x55f30de21510> #<pointer 0x55f30de21f90>)
scheme@(guile-user) [1]> str-1
$3 = #<pointer 0x55f30de21510>
scheme@(guile-user) [1]> (map pointer->string $2)
$4 = ("Hello" "there!")
scheme@(guile-user) [1]> (make-c-struct (list '* '*) (list (string->pointer "hello
 ") (string->pointer "there!"))) $5 = #<pointer 0x55f30e235aa0>
scheme@(guile-user) [1]> (parse-c-struct $5 (list '* '*))
$6 = (#<pointer 0x55f30de25e80> #<pointer 0x55f30de26a30>)
scheme@(guile-user) [1]> (map pointer->string $6)
$7 = ("hello " "there!")
scheme@(guile-user) [1]> (make-c-struct (list '* '*) (list (string->pointer "hello")
 (string->pointer "there!"))) $8 = #<pointer 0x55f30e076470>
scheme@(guile-user) [1]> (parse-c-struct $8 (list '* '*))
$9 = (#<pointer 0x55f30de28020> #<pointer 0x55f30de28bd0>)
scheme@(guile-user) [1]> (map pointer->string $9)
$10 = ("hello" "there!")
scheme@(guile-user) [1]> (make-c-struct (list '* '*) (list (string->pointer "hello")
 (string->pointer "there!"))) $11 = #<pointer 0x55f30e0453e0>
scheme@(guile-user) [1]> (parse-c-struct $11 (list '* '*))
$12 = (#<pointer 0x55f30de2a170> #<pointer 0x55f30de28bd0>)
scheme@(guile-user) [1]> (map pointer->string $12)
$13 = ("hello" "there!")
scheme@(guile-user) [1]>
Posted by Anonymous at 28 Mar 2019, 12:33:15 UTC Language: scheme • Views: 4
© The GNOME Project

GNOME Pastebin. Hosted by Red Hat. Powered by Sticky Notes © 2014 Sayak Banerjee.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2019-03-28 15:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 13:14 make-c-struct and pointer->string David Pirotte
2019-03-28 15:15 ` Amirouche Boubekki
2019-03-28 15:42   ` Neil Jerram
2019-03-29  8:48     ` David Pirotte
2019-03-29  9:46       ` David Pirotte
2019-03-29 19:08         ` Neil Jerram
2019-03-28 15:48   ` David Pirotte [this message]
2019-03-30 20:26 ` Mark H Weaver
2019-03-31 10:38   ` David Pirotte
2019-04-01  6:23     ` Mark H Weaver
2019-04-01  8:50     ` Mark H Weaver
2019-04-02 18:03       ` David Pirotte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190328124825.1da7d371@capac \
    --to=david@altosw.be \
    --cc=amirouche.boubekki@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).