From: "David A. Black" Date: 2009-10-10T23:55:48+09:00 Subject: Re: Poll on Eval in Ruby. --1926193751-261271509-1255186527=:4671 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-261271509-1255186527=:4671" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-261271509-1255186527=:4671 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi -- On Sat, 10 Oct 2009, Jes�s Gabriel y Gal�n wrote: > On Sat, Oct 10, 2009 at 7:10 AM, lith wrote: >>> If you want to contribute few seconds, the poll is >>> on my blog, on the top of the right column. >> >> Are we talking about >> >> � �a = 'foo' >> � �b = 'a + "bar"' >> � �eval "'yummy ' + #{b} * 2" >> >> or about >> >> � �class A >> � � � �def initialize >> � � � � � �@x = "foo" >> � � � �end >> � �end >> >> � �A.new.instance_eval {@x} > > I thought we were talking about all eval version (eval, instance_eval, > class_eval, etc) so I answered the one that was "has it's place" or > something like that. > > If we are talking exclusively about pure eval, I agree with David, I > almost never use it. I make a distinction between *eval'ing a string, which always carries all the dangers of regular eval, and the block forms of instance_eval and class/module_eval, which are very different techniques and don't have the same dangers. David -- The Ruby training with D. Black, G. Brown, J.McAnally Compleat Jan 22-23, 2010, Tampa, FL Rubyist http://www.thecompleatrubyist.com David A. Black/Ruby Power and Light, LLC (http://www.rubypal.com) --1926193751-261271509-1255186527=:4671-- --1926193751-261271509-1255186527=:4671--