From: Johannes Friestad Date: 2005-12-30T05:44:23+09:00 Subject: Re: What is the difference between :foo and "foo" ? On 12/29/05, Chad Perrin wrote: > Ever since this discussion started, I've wondered if there was some > relationship between Ruby symbols and Lisp symbols.. > So tell me: Is a Ruby symbol basically just an object oriented > implementation of the Lisp concept of a symbol? Yes, the concept of a symbol in Ruby is the same as in Lisp. Just as similar as the concepts for integers, strings, arrays and other basic constructs. I think the confusion comes from two areas: 1) Not many languages has 'symbol' as a distinct data type. Java has interned strings, which are pretty close to symbols for most practical purposes (symbols are atomic, immutable and unique, Java interned strings are just immutable and unique), but they are not a separate datatype. 2) It is not immediately obvious why symbols are useful. Numbers and arrays/lists are easily explained as representing numbers and 'a construct to hold multiple values', but there is no such simple explanation for symbols. Not that I know of, anyway. jf