On 13/11/2013 11:32, Carlo E. Prelz wrote:
> The line
>
> x = x + 1
>
> creates a new object. You can see this by printing the object id of x
> before and after the sum:
>
> ...
> def f(x)
>    puts("before: #{x.object_id}")
>    x = x + 1
>    puts("after: #{x.object_id}")
>    return x
> end
> ...
>
> gives here:
>
> before: 5
> after: 7
>
> Carlo
>

So a parameter is passed by reference but as soon as you modify it 
you've cloned the object? Then what's the point passing it by reference 
in the first place?

gvim