[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unsafe psyntax label generation
From: |
David Kastrup |
Subject: |
Re: Unsafe psyntax label generation |
Date: |
Wed, 25 Jan 2012 14:46:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Mark H Weaver <address@hidden> writes:
> Andy Wingo <address@hidden> writes:
>
>> On Tue 24 Jan 2012 15:01, Mark H Weaver <address@hidden> 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))
Dingdingding. That sounds to me like I am not the only person of the
opinion that (eq? (string) (string)) is a standard-compliant
implementation choice. I know this was a different discussion
altogether but thought it might be worth pointing out.
--
David Kastrup