From: "Dmitry V. Sabanin" Date: 2003-11-25T13:46:47+09:00 Subject: Re: Controlled block variables On Tuesday 25 November 2003 02:02, T. Onoma wrote: > No. Eval is for constructing code piecemeal with various variables, not > just to do what can already be done without it. But as it stands, one must > build literals within strings to accomplish such things. That's a lot of > extra work and makes for choppy ugly code. I think that eval just gives access to ruby interpreter itself in run-time. How could it behave differently from ruby then, if it _is_ ruby? That's just a needless ambiguity. > Of course, the above example dosen't really do what I want it to. For that, > I have to get fancy: > > p "#{a.join(',')}" You can just do p "#{a.inspect}", as it works great with strings, arrays and hashish..oops..hashes :). Or you always can define a method, i.e. to_evil in String, Array, Hash, or in any other class you use in eval, and use it like #{a.to_evil}. As I see it, it's just ten lines or so. You can't change ruby behavior for things just to make it more comfortable for you, sometimes you have to change the way _you_ do it. > I don't like getting fancy. Who likes? :) -- sdmitry -=- Dmitry V. Sabanin MuraveyLabs.