From: Jim Weirich Date: 2005-03-17T13:36:39+09:00 Subject: Re: Symbol vs String 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. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)