bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20087: gensym


From: Ludovic Courtès
Subject: bug#20087: gensym
Date: Tue, 22 Mar 2016 08:58:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Mark H Weaver <address@hidden> skribis:

> I've considered this idea in the past, but it only avoids collisions
> with symbols that have been interned before the gensym.  It does not
> avoid collisions with symbols interned *after* the gensym.  Obviously,
> there's no way to avoid such collisions.

Yeah, good point.

> If we cannot eliminate the possibility of collisions, and we cannot
> avoid intentional collisions, what can we do?  I think the best we can
> hope for is to significantly reduce the probability of _unintentional_
> collisions, perhaps by starting the gensym counter at a large number.

I’m not sure if that would help.

One thing that could help avoid unintentional collisions is to
automatically add whitespace before the number, such that:

  (gensym "x") => #{x 123}#

(This is already the case when called with no arguments.)

> The other thing we can do is to clearly document these inherent problems
> with gensym, so that they will not be misused for jobs for which they
> are not appropriate.

I think we should add a sentence to that effect in the manual.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]