From: Aleks Kissinger Date: 2006-07-30T17:52:32+09:00 Subject: Re: does ":" have an anolog in another language? As far as an analogue in other languages, I tend to think of symbols sortof like old-style C defines. #define HAS_EGGS 1 #define CAN_FRY 2 add_property(HAS_EGGS); add_property(CAN_FRY); ...or y'know something like that. Its a constant that has some meaning, but all you really care about is it's unique. add_property(:has_eggs) add_property(:can_fry) But all the #defines and stuff are automatic. You could use strings, sure, but just like in C, I sortof get this sickly feeling when I use (slow) strings when I don't have to. This explanation skips over all the crazy OO stuff you can do with symbols, but I'd say thats the closest thing you can get to their equivalent in another language. On 7/29/06, Charles Hoffman wrote: > > On Sat, Jul 29, 2006 at 10:15:09AM +0900, Ike wrote: > > > > > Doesn;t that therefore make it the same thing as a reference in c++ ? > > In Lisp,. the way I was explaining it, yes -- in the sense that they are > what Lisp uses for variables. In Ruby, they are more like the > occurrences of symbols in Lisp in which they typically start with a : -- > they mean whatever you decide they mean. You might use them to index a > collection (e.g. a Hash) or you can assign them whatever semantic > meaning suits your intentions. > > --ch-- > > >