This language bar is your friend. Select your favorite languages!

Idiom #227 Copy list

Create new list y containing the same elements as list x.

Subsequent modifications of y must not affect x (except for the contents referenced by the elements themselves if they contain pointers).

y := make([]T, len(x))
copy(y, x)
let y = x.slice();
y = x.dup

Do you know the best way to do this in your language ?
New implementation...

Idiom created by