From: Shannon Fang Date: 2002-12-01T08:57:22+09:00 Subject: Re: Ruby Document Hi Bill, On Sun, 1 Dec 2002 06:47:06 +0900 "Bill Kelly" wrote: > the source code, except that the :name syntax is a short cut for > "name".intern. Trouble is, :name is arbitrary, as I tested in irb. It seems when you type :name, it is dynamically created in the system. And if in the system there are a variable called name defined, you can not reference to name through :name. Is it correct? If so, it is hard for me to think of any use of symbol, except that it may save some bytes of memory. Please see below. > irb> prompt = "'which method do you want?'", "t.send(:a)" > ["'which method do you want?'", "t.send(:a)"] Now is the problem makes my brain a mess. When you use t.send(:a), how can the interpreter know to map :a to method a?? As I experimented, :a can exist independent of a, and even there is a exists in the system, you can't use :a to reference a. p :a will output :a, not a, or value of a! If :a is independent to any other variable, it can only be a "immutable" or very economic string, what's the big deal? Can't you use string.freeze to make it immutable (if it is really necessary)? Please help... :'( Shannon