Project

General

Profile

Actions

Bug #800

closed

Problem with Array class

Added by Francoys_Proulx (Francois Proulx) almost 16 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-core:20158]

Description

=begin
If you test this simple program, you will see why array should be dup on assignment ...

a=1
b=1
c=[a,b]

def foo(x)
  x[0] +=1
  x[1] +=1
end

d = c
e = d
f = e

foo(f)

p c[0],c[1]

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0