From: tonys@... (tony summerfelt) Date: 2000-12-23T12:40:12+09:00 Subject: [ruby-talk:7987] Re: Hash access method On Sat, 23 Dec 2000 03:24:26 +0900, Dave Thomas wrote: > > I wonder if the ruby 1.8 could allow "." access > > to Hash object. such as > However, ignoring this small issue, you can implement something > similar for yourself: > I love this language! the more i read 'programming ruby' the more i like the language. i'm not quite finished yet, but i do have a quick 'is this possible' question: i'm porting my palm pilot game to both python and ruby. i need to define 26 objects (coincidentally named a to z :) in python i can do this: #!/usr/bin/python import string, gebplanet for letter in string.lowercase: exec '%s=gebplanet.planet()' % letter exec '%s.name(letter)' % letter the for loop cycles through the letters. the '%s=' line gets the current letter and initializes an object instance. the '%s.name' line is a work around for the object to know the 'name' it was initialized under. is there anyway to do this in ruby? i'd rather not write 26*2 lines to initialize the objects i need...