[gambit-list] Low prio feature request: GC:able symbols, perhaps via a separate configure option --enable-gc:able-symbols

Mikael mikael.rcv at gmail.com
Tue Sep 24 18:33:38 EDT 2013

Ordinary symbols are special in that they are the only values created by
Scheme code on runtime that are not garbage collected currently.

(The other ones would be any compiled code you load and ___PERM objects you
allocate in C.)


> (define t (make-table weak-keys: #t weak-values: #t))
> (table-set! t (string->symbol "abc") (string->symbol "def"))
> (table-set! t "ghi" "jkl")
> (table-set! t (make-uninterned-symbol "mno") (make-uninterned-symbol
> (##gc) (##gc) (##gc)
> > > (table->list t)
((abc . def))

2013/9/25 Adrien Piérard <pierarda at iro.umontreal.ca>

> Hum, I might have completely misunderstood many things, from what you
> wrote to how symbols work, but what if I have a symbol stored as a
> weak reference in a table, and it gets garbage collected. If I later
> re-read this symbol from the network, then I won't find it in the
> table, will I? But wasn't I guaranteed I'd find it  *because* it's a
> symbol and thus the table should still be containing an element EQ to
> the one I just got from the network?
> P!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130925/f72e0ee1/attachment.htm>

More information about the Gambit-list mailing list