From: wconrad@... Date: 2002-05-02T04:07:00+09:00 Subject: Re: Auto-quoting simple hash keys? On Thu, May 02, 2002 at 03:35:06AM +0900, Berger, Daniel wrote: > What would people think of auto-quoting simple hash keys in Ruby (ala Perl)? > > i.e. hash[key] would be equivalent to hash['key'] No, I would be surprised too often. When I find myself indexing a hash by only constant strings, it might mean that I actually need a class instead of a hash. The wonderful Struct class makes it very easy to make a data-holder class to use instead of a hash. Then I can say foo.key instead of foo['key'] (or the proposed foo[key]). It looks even better without the brackets. Wayne Conrad