From: "Mauricio Fernández" Date: 2003-05-21T18:57:31+09:00 Subject: Re: An Object Going Out Of Scope On Wed, May 21, 2003 at 05:56:34PM +0900, Robert Klemme wrote: > > > > It seems you overlooked the fact that it is not implementable in current > > Ruby, for it needs Procs to be rebound :) > > I'm not sure, whether I understand you correctly. The solution below does > work. Why then is it not possible without rebinding procs? I meant my method, which is used like this auto(:var1, :var2, :etc) do .... end ie. def auto(*vars, &block) begin block.rebind(binding).call # rebind not in Ruby!!! ensure vars.each { |x| eval "#{x}.cleanup if #{x}" } end end The idea is getting 'var = foo" inside the block to create the local in the outer scope (binding). You had better forget about this stupid thing of mine, and stay with the good, implementable thing :-) -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com > 1. is qmail as secure as they say? Depends on what they were saying, but most likely yes. -- Seen on debian-devel