unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: modifying pointers
Date: Fri, 09 Apr 2010 22:15:21 +0200	[thread overview]
Message-ID: <m3tyrkpeli.fsf@pobox.com> (raw)
In-Reply-To: <87fx34mmt4.fsf@gnu.org> ("Ludovic Courtès"'s message of "Fri, 09 Apr 2010 21:46:15 +0200")

Hi!

On Fri 09 Apr 2010 21:46, ludo@gnu.org (Ludovic Courtès) writes:

> Andy Wingo <wingo@pobox.com> writes:
>
>> I'm just wondering if it is valid to create a ((void*) 777) pointer.
>> Under what condition is that useful?
>
[...]
> It opens the door to all sorts of crazy things.  :-)

Cool :)

FWIW, let's kick that door off its hinges :-)))

>> If that is useful, OK; but under what condition is it useful to mutate
>> the pointer in a foreign pointer object? Why not create a new foreign
>> pointer object?
>
> There’s currently no procedure to create a foreign object from a
> bignum.

Perhaps we should define one then. It would be more expressive. Also it
avoids all kinds of shared-state problems.

> (Besides, ‘foreign-set!’ exists and has always been defined for all
> types of foreign pointer objects.)

Sure, but this might be an accident. In every case except `void',
foreign-set! modifies the pointed-to memory. Perhaps we need a
foreign-pointer accessor instead, which would work on pointers to values
as well. And a constructor of course.

Andy
-- 
http://wingolog.org/




      reply	other threads:[~2010-04-09 20:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09  9:05 modifying pointers Andy Wingo
2010-04-09 16:30 ` Ludovic Courtès
2010-04-09 16:59   ` Andy Wingo
2010-04-09 19:46     ` Ludovic Courtès
2010-04-09 20:15       ` Andy Wingo [this message]

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=m3tyrkpeli.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@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).