Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
List<T> y = x.ToList();
List<Int32> y = new List<Int32>(x);
y = [...x];
type (foo), allocatable, dimension(:) :: y
y = x
y := make([]T, len(x))
copy(y, x)
let y = x.slice();
local function deepcopy(input)
local t=type(input)
if t~="table" then
return input
end
local copy={}
for k,v in pairs(input) do
k=deepcopy(k)
v=deepcopy(v)
copy[k]=v
end
return copy
end
local y=deepcopy(x)
y = x[:]
y = x.copy()
y = x.dup
let y = x.clone();