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 18:59:16 +0200	[thread overview]
Message-ID: <m3wrwgr28r.fsf@pobox.com> (raw)
In-Reply-To: <87k4sgpp0w.fsf@gnu.org> ("Ludovic Courtès"'s message of "Fri, 09 Apr 2010 18:30:07 +0200")

Hi,

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

> Andy Wingo <wingo@pobox.com> writes:
>
>> You added a change to foreign-set! for %null-pointer. Would it not make
>> sense instead to make foreign pointers of type "void" unsettable?
>
> Not necessarily.  See the test that was added:
>
>   (pass-if "foreign-set! other-null-pointer"
>     (let ((f (bytevector->foreign (make-bytevector 2))))
>       (and (not (= 0 (foreign-ref f)))
>            (begin
>              (foreign-set! f 0)
>              (= 0 (foreign-ref f)))
>            (begin
>              ;; Here changing the pointer value of F is perfectly valid.
>              (foreign-set! f 777)
>              (= 777 (foreign-ref f))))))
>
> Here a ((void *) 777) pointer is created.

I'm just wondering if it is valid to create a ((void*) 777) pointer.
Under what condition is that useful?

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?

Andy
-- 
http://wingolog.org/




  reply	other threads:[~2010-04-09 16:59 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 [this message]
2010-04-09 19:46     ` Ludovic Courtès
2010-04-09 20:15       ` Andy Wingo

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=m3wrwgr28r.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).