You wrote:
> On 23 Dec 2000 12:35:07 +0100, Clemens Hintze wrote:
> > A Python similar solution would looks like:
>  
> > But I would use the #{} construct in strings ...
>  
> >   for letter in 'a' .. 'z'
> >     eval "%{letter} = Planet.new"
> >     eval "%{letter}.name('%{letter}')"
> >   end
> 
> > Still very close to Python, isn't it? :-)
> 
> the rubified version looks cleaner and more readable. i'm a bit
> suprised at how close to python it DOES look.

But unfortunately it will not work! :-(

As somebody else already pointed out, the Ruby compiler would not able
to detect that 'a' .. 'z' are variable names. During compilation these
variables didn't exists, but were created during runtime. If
afterwards you try to access them simply by name, ruby has already
decided to see them as parameterless method call instead of variable
query.

As I have only tried that piece of code in irb, I had not detect
this. But this is not an excuse, as I should know this already :-(

> i'm still relatively new to python so i'm not stuck on the way
> python does things. i want my ruby code to look like the ruby way of
> doing things as much as possible...

A very good idea ...

I thing anyway, that the better solution would be to use a Hash to
store these references. Or wrap them into classes or such ...


Never mind,
\cle