Marko Rauhamaa writes: > Christopher Allan Webber <cweb...@dustycloud.org>: > >> I thought they weren't but now I'm not really sure where I got that >> idea from. Does anyone know for sure? > > I don't think the language spec says anything about any particular > object or object type being garbage collected. Symbols are first-class > objects and undergo the same treatment as any other object.
Yes, though they are intern'ed, and symbols are not always garbage collected. I know in Ruby at one point they were not, I heard today they aren't in Erlang either, and even until apparently recently they weren't GC'ed in MIT Scheme I think: https://www.gnu.org/software/mit-scheme/release.html "Symbols can now be garbage-collected." in 9.1 even.. that came out in 2011! Anyway it looks like Guile does indeed garbage collect symbols. I have no idea how I got the impression that it did not, but it looks like it isn't unusual for symbols to not be GC'ed in a number of languages.