From: Joel VanderWerf Date: 2006-10-25T01:53:07+09:00 Subject: Re: What's the difference between send and instance_eval? michele wrote: > So there is no need for "send"? One use of #send: a=[] @x=3 a.send :<<, @x p a @x=4 a.instance_eval { self << @x } p a __END__ Output: [3] [3, nil] This is because @x is in a different scope inside the instance_eval block. Another case, showing the real point of #send: msg = :reverse a = [1,2,3] b = a.send msg p b __END__ Output: [3, 2, 1] There's no easy equivalent with #instance_eval and blocks (you could mess with strings, though). -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407