How useful is the feature of having an atom data type in a programming language?
A few programming languages have the concept of atom or symbol to represent a constant of sorts. There are a few differences among the languages I have come across (Lisp, Ruby and Erlang), but it seems to me that the general concept is the same. I am interested in programming language design, and I was wondering what value does having an atom type provide in real life. Other languages such as Python, Java, C# seem to be doing quite well without it.
I have no real experience of Lisp or Ruby (I know the syntaxes, but haven't used either in a real project). I have used Erlang enough to be used to the concept there.
转载于:https://stackoverflow.com/questions/4874744/lisp-and-erlang-atoms-ruby-and-scheme-symbols-how-useful-are-they