Why mutable struct cannot be defined inside a function in Julia?
function test()
mutable struct ABC
x
y
z
a
end
end
throws error:
ERROR: LoadError: syntax: "struct" expression not at top level
But if the struct is global that is outside the function and accessed inside function, the code works fine.