I found out that querying a symbol's name using
symbol-name adds the symbol to
(intern-soft "random-name") ; gives nil (symbol-name 'random-name) ; adds random-name to obarray, gives "random-name" (string). (intern-soft "random-name") ; gives random-name
My concern is that this bloats
obarray with empty symbols (i.e no value or function definition). Is there
- something like
symbol-namewhich doesn't add the to the obarray?
- a way to clear the obarray of "useless" (all cells other than the name cell are empty) symbols?
I just found out that even evaluating a symbol adds it to the
obarray. So I am assuming this language (or any lisp) is designed in a way that you don't have to worry about the size of
obarray. Is this correct?