Mark J. Reed
7/16/2003 11:20:00 AM
On Wed, Jul 16, 2003 at 06:41:11PM +0900, Mauricio Fernández wrote:
> > module Kernel
> > def with(obj, &blk)
> > obj.instance_eval &blk
> > end
> > end
This has apparently been proposed before. The resistance to
including it may simply come from the fact that, from a general
design perspective, instance_eval is a Bad Thing(TM). It violates
encapsulation and removes an object's ability to manage its own data.
There are legitimate uses for it on occasion, so the capability is
good to have, but if it were *easier* to do, it would probably be
(ab)used more often.
-Mark