From: "Berger, Daniel" Date: 2002-05-02T04:10:45+09:00 Subject: RE: Auto-quoting simple hash keys? > -----Original Message----- > From: wconrad@yagni.com [mailto:wconrad@yagni.com] > Sent: Wednesday, May 01, 2002 2:07 PM > To: ruby-talk@ruby-lang.org > 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 > Hmm...I'm getting the feeling most people agree with you. Ah, well. I can live with it (and maybe it's for the best anyway). :) Dan