From: Robert Klemme Date: 2010-10-21T23:46:13+09:00 Subject: Re: about handling args in block On Thu, Oct 21, 2010 at 4:42 PM, salamond wrote: > Let's see if I get this. > While I'm passing @left_node, and @right_node into this block, > I'm passing the reference of these 2 objects into a block. > Inside block, I can use these 2 references to modify the objects, > but I can't change the reference themselves. Exactly. > Now here comes an update, is there a way to have the class destroy itself? No. Please note Ruby != C++. > like > class Node > #snip >    def destroy >        self = nil >    end > end > > [@left_node, @right_node].each do |node| >    node.destroy > end > > Is it possible to have something like this work? > When I try this, it said can't change the value of self. Which is the truth. Please read on object finalization in Ruby. robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/