From: Sam Roberts Date: 2005-03-18T23:36:19+09:00 Subject: Re: Symbol vs String Quoting jim@weirichhouse.org, on Thu, Mar 17, 2005 at 01:36:39PM +0900: > On Wednesday 16 March 2005 09:29 pm, Sam Roberts wrote: > > Quoting jim@weirichhouse.org, on Thu, Mar 17, 2005 at 11:08:59AM +0900: > > > Use Strings for their content. Use Symbols for their arbitrary > > > uniqueness. > > > > I used to do this, but ran into problems. > [...] > > :octet-stream > > > > NameError: undefined local variable or method `stream' for main:Object > > from (irb):3 > > 'octet-stream'.intern > > ==>:"octet-stream" > > Why couldn't you do :octet_stream ? If your answer is because the dash comes > from outside ruby, then I would suggest that the content ("_" vs "-") is > important ... indicating that you should use strings. Maybe I don't know what you mean by "arbitrarily unique". "_" vs "-" is no more (or less) important than "a" vs. "z". Cheers, Sam