From: Robert Dober Date: 2006-04-19T22:51:18+09:00 Subject: Re: interested in metaprogramming? ------=_Part_6024_12315571.1145454673201 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/19/06, Gregory Seidman wrote: > > On Wed, Apr 19, 2006 at 06:31:47PM +0900, chiaro scuro wrote: > } two people is already a crowd to me :-) > } > } I'll let you know when I post more about metaprogramming and DSLs. > > I only skimmed what you've written so far, but I noticed that you've used > class_eval. It is preferable to avoid any form of eval whenever possible. > In your post you can replace... Could not agree more but I am desperately looking for a way to replace this which I use *very* often class Mine eval <<-EOS def #{name}( value, &block ) do_something( &block ) if block_given? end EOS end I'd *love* to do it with define_method, but I do not get around the "&block= " parameter. Anybody help? Thx Robert -- Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_6024_12315571.1145454673201--