From: Lou Vanek Date: 2005-12-09T21:19:58+09:00 Subject: Re: How to pass numeric variables by reference? probably assign on callback. In other words, Ruby doesn't have a direct pass-by-reference operation for numbers, but you can easily achieve the same result. using irb: 10 :> def foo(c,d) return c+1, d+2 end ==> nil 13 :> a,b = 5,6 ==> [5, 6] 14 :> puts a,b 5 6 ==> nil 15 :> a,b = foo(a,b) ==> [6, 8] 16 :> puts a,b 6 8 Eric Christensen wrote: > What's the Ruby way of achieving pass-by-reference for numbers, as in > the C code > > void foo (int* x) > { > > }