From: Kirk Haines Date: 2006-06-16T23:35:49+09:00 Subject: Re: API style preference? a.b=c or a(:b=>c) On Friday 16 June 2006 6:29 am, Robert Klemme wrote: > I'd just stick with > > DocRootNames = [nil,'docs','doc','htdocs','htdoc'].freeze > > Or, if you're paranoid > > DocRootNames = [nil,'docs','doc','htdocs','htdoc'].each {|x| > x.freeze}.freeze > > Although freezing nil may have undesirable effects. No you need that > nil in there? If not you could even do I actually do need that nil there, though the freezing is arguably superflous for my needs. However, the whole point in that boilerplate is that I am checking const_defined? and not redefining the const if it is already defined. If I eliminate the boilerplate, I eliminate typing the same same thing thing over and over again, but then the code generates piles of warnings that I don't care to generate, either. But really, that's neither here nor there. I mostly curious about people's stylistic preferences (and why the preference): constant.Foo = :bar or constant(:Foo => :bar) Thanks, Kirk Haines