48 ms·
> Symbols aren't much like strings. They're immutable, and actually just refer to a unique number, not characters. Depending on language, that could make them
by randallsquared 14y ago
> Symbols aren't much like strings. They're immutable, and actually just refer to a unique number, not characters.
Depending on language, that could make them exactly like strings. :)
- derleth 14y agoIf you have immutable strings and a smart compiler, yes, you could indeed have strings and symbols that are functionally identical. In fact, in Old Lisp, there were no strings and symbols were used for everything we use strings for now; that lead to weak string handling and it's why Common Lisp and all modern Lisp variants have a string type.