From: Xavier Noria Date: 2010-10-03T08:59:23+09:00 Subject: Re: Pass by reference and copy on write On Sun, Oct 3, 2010 at 1:41 AM, Ralph Shnelvar wrote: > I see >  http://www.ruby-forum.com/topic/41160 > > which has a fairly long explanation of passing stuff by reference and copy on write(cow). A very noisy thread. > Let's say I have >  def som_func(x,y) >   x = 24 >   y = 42 >  end >  . >  . > >  a=1 >  b=2 >  . >  . >  . >  some_func(a,b) > > > and I want to have some_func change a to 24 and b to 42 ... > > How do I do it? You can't. Ruby, C, and Java are pass-by-value. With that method call semantics what you ask is not possible. You certainly can change the state of a mutable object, but that is unrelated. Perl is pass-by-reference, you can do that in Perl. This is jargon, the word "reference" in "pass-by-reference" has nothing to do with the "references" that Java or Ruby manage. Same term, different meanings.