From: Jason Roelofs Date: 2007-10-20T01:03:35+09:00 Subject: Re: the level of Ruby programmers vs PHP's ------=_Part_4738_27738704.1192809812116 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/19/07, Phlip wrote: > > > Ugly solution: > > def debug_eval(code, binding) > > puts "#{code}\n=> #{eval(code, binding)}" > > end > > I think there's some way to get the binding without passing it in. Just default-arg it to the top binding. def debug_eval(code, binding = TOP_LEVEL_BINDING) puts "#{code}\n => #{eval(code, binding)}" end Jason ------=_Part_4738_27738704.1192809812116--