From: Austin Ziegler Date: 2003-08-05T03:25:31+09:00 Subject: Re: clearing a parameter in Ruby? On Tue, 5 Aug 2003 02:36:32 +0900, Roy Patrick Tan wrote: > is it possible to write a method that can "clear" a parameter in Ruby? > That is can a write a method "push" such that for the code below: > > x = "Hello" > string_stack.push(x) > puts x > > the output will be nil instead of "Hello"? No. x is a local variable that refers to "Hello". A method can't affect an outer local variable. Why do you wish to do this? We might be able to help you figure out a better way to do what you're trying to do. -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.08.04 * 14.23.07