From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: Unsafe psyntax label generation
Date: Tue, 24 Jan 2012 22:27:27 +0100 [thread overview]
Message-ID: <87ehuolrk0.fsf@pobox.com> (raw)
In-Reply-To: <87zkddqjwz.fsf@netris.org> (Mark H. Weaver's message of "Tue, 24 Jan 2012 09:01:16 -0500")
On Tue 24 Jan 2012 15:01, Mark H Weaver <mhw@netris.org> writes:
> `local-eval' combines syntax objects from two different sessions into a
> single syntax object (in the wrapper procedure), and thus there may be
> label name collisions. Now, if this combined syntax object is
> serialized as a compiled procedure, these labels with the same name will
> be optimized together into the same string object!
A very good point!
Cf. Aziz's psyntax/expander.ss from r6rs-libraries.dev:
;;; (two marks must be eq?-comparable, so we use a string
;;; of one char (this assumes that strings are mutable)).
;;; gen-mark generates a new unique mark
(define (gen-mark) ;;; faster
(string #\m))
;;; every identifier in the program would have a label associated
;;; with it in its substitution. gen-label generates such labels.
;;; the labels have to have read/write eq? invariance to support
;;; separate compilation.
(define gen-label
(lambda (_) (gensym)))
His gensyms are globally unique; he made the exact opposite choice that
I did in the fd5985271fee3bcb6a290b6ad10525980a97ef8d; interesting. I
wonder who is right here.
> Maybe there's something I'm missing here, but if the change you made
> above was safe, I think the burden of proof is on you to explain why.
Indeed, and I think you found a good indication that it's not right.
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2012-01-24 21:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 14:01 Unsafe psyntax label generation Mark H Weaver
2012-01-24 21:27 ` Andy Wingo [this message]
2012-01-25 1:41 ` Mark H Weaver
2012-01-25 13:21 ` Ludovic Courtès
2012-01-25 14:27 ` Andy Wingo
2012-01-25 13:46 ` David Kastrup
2012-01-26 11:26 ` 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=87ehuolrk0.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=mhw@netris.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).