From: Aldric Giacomoni Date: 2010-04-01T01:51:01+09:00 Subject: Re: return number of spaces at the beginning of a line thunk wrote: > On Mar 31, 7:19�am, Aldric Giacomoni wrote: >> > I would not normally care much, or feel a particular need to >> Do you expect this code to work? >> >> I think you're using symbols inappropriately. What -are- you doing with >> them? If you need to add two names together, then my guess is, just >> stick with strings. >> -- >> Posted viahttp://www.ruby-forum.com/. > > just quickly: they start life as a method name so i was hoping they > could stay symbols - but i need a tie breaker for the one level key > that becomes a simpleton method (name) in this "whiteboard" class. i > keep trying to use all symbols. note: ruby is not fighting me with > the /?!/ - so the door seems open to bite the bullet and convert -> > append -> reconvert but it "hurts" my sense of symmetry - but thanks - > that makes perfect sense (and now that i think about it- it had to be > that way, almost). > > thunk Well, it sounds like you're using symbols for the wrong purpose, but I repeat myself. You may want to take a look at this Rails bit: http://railsbrain.com/api/rails-2.3.2/doc/index.html?a=C00000033&name=HashWithIndifferentAccess I'm not saying you should use that, or even think in that direction. It does however sound similar to what you're doing. When designing something, the rule is to ask 'why' five times. You want to use symbols. Why? .. They start life as a method name. Okay, well, you can send strings to "call", not just symbols. So.. Why do you want to use symbols? If the answer is "Oh, because I want to avoid using strings", then the next question is .. Why do you want to avoid using strings? ;-) It sounds like you're doing some strangely heavy string manipulation. Why use symbols at all? -- Posted via http://www.ruby-forum.com/.