From: Shannon Fang Date: 2002-12-01T02:56:12+09:00 Subject: Re: Ruby Document Thanks again, but for give my dumbness, still some questions: >S> What is a symbol? what is the difference between symbol and variable? > > a symbol is an Object, like an Integer, Array, ... > According to the manual: "A Ruby symbol is the internal representation of a name. You construct the symbol for a name by preceding the name with a colon. A particular name will always generate the same symbol, regardless of how that name is used within the program." Does it mean: If I see a symbol in a program, like :PropFind, I can safely assume that in the same program, there are a name PropFind, which is related to this symbol? Another question is, if the above understanding is right (or wrong), what is the use of a Symbol? Why need a symbol? what is the difference between :PropFind and PropFind?? I do need some documents, otherwise might keep harassing you people :-p > For example > > class HTTP > def HTTP.get(a, b) > end > > def gets(d) > end > end > > HTTP::get is a class method > HTTP#gets is an instance method In your above example, :: and # is only used in documents? But in real program, you only use "."? So in def clause within a class, if classname is used as above, it is class method? Shannon > > >Guy Decoux _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus