copy_list


copy_list(xs)
      

Return an exact copy of the list xs.

Examples:


let ys = [1, 2, 3]
let xs = [10, ys, 20]
let zs = copy_list(xs)
set_head(zs, 100)
xs
// [10, [1, 2, 3], 20]
zs
// [100, [1, 2, 3], 20]
set_head(ys, 200)
xs
// [10, [200, 2, 3], 20]
ys
// [200, 2, 3]
zs
// [100, [200, 2, 3], 20]
      

Core Module Index | Contents