Named arguments in type

Hello is there way to construct struct by their argument names e.g.:

type Position
    x::Int
    y::Int
end

# OK
Position(1, 2)
# MethodError: no method matching Position(; x=1, y=2)
Position(x=1, y=2)

Check out the Parameters.jl package.

3 Likes

Thanks, looks what I need