From: Clifford Heath Date: 2008-03-12T12:00:43+09:00 Subject: Re: setting local variables via eval Rick DeNatale wrote: > On 3/11/08, Joel VanderWerf wrote: >> Rick DeNatale wrote: >> > On 3/11/08, ara howard wrote: >> Not quite. >> >> view = View.new ' #{ x + y } #{locals} ' >> puts view.render(:x => 40, :y => 2) # ==> 42 x40y2 > > Not on my machine: > > RubyMate r8136 running Ruby r1.8.6 > (/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby) >>>> untitled > > 42 > Program exited. I don't know what's different about your environment, Rick, but the point I made elsewhere in this thread is that the version that both you and Robert offered doesn't present a clean scope for the added locals, it just re-uses the local scope of "render". That means you can both expand and clobber render's internal variables, as I showed. Clifford Heath.