From: Bulat Ziganshin Date: 2002-11-28T16:03:31+09:00 Subject: Re: call-by-reference problem again Hello Shannon, Wednesday, November 27, 2002, 11:52:59 PM, you wrote: SF> I encountered the call-by-reference problem, which was discussed SF> before in this group. Please have a look at the following code: SF> def test!(str) SF> str=str.upcase SF> end SF> str="hello" SF> print str,"\n" SF> test!(str) SF> print str,"\n" def test!(str) str.upcase! end SF> The problem here is, we have seen some Ruby methods, like String.chomp! SF> and many that end with a !, they can modify parameters in place, how is SF> it done?? Is it possible to do this in programming, or is it only SF> available in standard libraries, which may be implemented outside of SF> ruby (eg. in C)? ruby is not created with ability to modify parameters in mind. so you must not rely on this programming paradigm. use arrays or multiple return values or something other -- Best regards, Bulat mailto:bulatz@integ.ru