From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: GNU Guile branch, stable-2.0, updated. v2.0.2-101-gd851e32
Date: Sun, 25 Sep 2011 22:34:39 +0200 [thread overview]
Message-ID: <87d3eo5pk0.fsf@gnu.org> (raw)
In-Reply-To: 87wrcxpz1c.fsf@yeeloong.netris.org
Hi Mark,
Mark H Weaver <mhw@netris.org> skribis:
>> commit d851e32fdc3d14804108f0389faa75a57599ced4
>> Author: Andy Wingo <wingo@pobox.com>
>> Date: Fri Sep 23 18:02:05 2011 +0200
>>
>> prevent propagation for memory-dependent operations like `car'
>>
>> * module/language/tree-il/primitives.scm (*primitive-constructors*):
>> Record car, cdr, vector-ref, and struct-ref as "constructors".
>> Comment to come later.
>
> If car, cdr, vector-ref and struct-ref are to be included in this set of
> operations, it seems to me that the set should be renamed to something
> other than "constructors".
>
> Note that peval should not perform (in advance) any operations that
> access _mutable_ memory, but accessing non-mutable memory should be
> fine.
These operations need special care because they return a mutable object,
which must be protected against copy propagation, as in:
(let ((x (cons (list 1) (list 2))))
(set-car! (car x) 0)
(car x))
We discussed this on IRC and failed to come up with a nice name, which
is why Andy kept this one.
> Instead of moving those operations into the *primitive-constructors*
> set, perhaps we should make a new set of primitives called something
> like *primitive-mutable-accessors* ?
Yes, though it’s not the accessor that’s mutable. :-)
‘mutable-object-returning-primitive’ would be descriptive but is hard to
read...
> If you're going to move car and cdr from one set to the other, shouldn't
> you do the same for caar, cadr, etc?
No because they get reduced to a sequence of car & cdr.
> Also, if I'm correct in guessing the reason for this change (accessing
> mutable memory), shouldn't the bytevector-*-ref operations go as well?
No because they return an immutable object.
Thanks,
Ludo’.
next prev parent reply other threads:[~2011-09-25 20:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1R78DA-0005aI-MY@vcs.savannah.gnu.org>
2011-09-24 18:37 ` GNU Guile branch, stable-2.0, updated. v2.0.2-101-gd851e32 Mark H Weaver
2011-09-25 20:34 ` Ludovic Courtès [this message]
2011-09-26 11:20 ` Andy Wingo
2011-09-27 20:37 ` Ludovic Courtès
2011-09-28 2:35 ` Noah Lavine
2011-09-28 9:25 ` Ludovic Courtès
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=87d3eo5pk0.fsf@gnu.org \
--to=ludo@gnu.org \
--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).