Re: gensym not creating unique symbols
Brian Denheyer writes:
> >>>>> "Lars" == Lars Thomas Hansen <lth_at_ccs.neu.edu> writes:
>
> Lars> So you really need to compare the _symbol_ returned from
> Lars> GENSYM with a standard symbol with the same print name. (If
> Lars> they compare eq?, I'd say you have cause for complaint :-)
Yes I think that you can complain!
In fact there is no notion of "uninterned" symbol in STk. Everything
is ready for that (i.e. the GC is), it is just the primitive for that
which lacks. In my opinion the string->symbol function should return
an uninterned symbol, since it allows to make symbol which cannot be
read back, but it is not the case. I can add a primitive
string->uninterned-symbol for resolving this problem. Of course, the
gensym function could use it et voilą.
>
> Actually I tracked down the code for gensym, and I don't think gensym
> will do what I would like. The code is in scheme and uses a simple
> counter captured in a closure.
>
> I don't see anyway that it could possibly "know" about symbols already
> generated.
>
> This is part of a larger issue for me, and probably lots of others,
> which is the "saving data in scheme and then reading it back in and
> re-establishing all of the references" problem.
>
> I was trying to generate data files which could be read back in using
> ONLY, (load "filename"), and the loaded expressions would "do the
> right thing". I was very successful with this approach until I
> realized I had data-structures which required references to other
> objects.
BTW, are you using the write* function for this job which handle
circular structures?
-- Erick
Received on Wed Jun 30 1999 - 08:54:32 CEST
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST