# Named arguments in type

**URL:** <https://discourse.julialang.org/t/named-arguments-in-type/6780>\
**Category:** General Usage\
**Tags:** syntax\
**Created:** [October 30, 2017, 4:49pm UTC](https://discourse.julialang.org/t/named-arguments-in-type/6780 "2017-10-30T16:49:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sysint64](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sysint64/32/2398_2.png) [@sysint64](https://discourse.julialang.org/u/sysint64)\
**Post date:** [October 30, 2017, 4:49pm UTC](https://discourse.julialang.org/t/named-arguments-in-type/6780/1 "2017-10-30T16:49:03Z")

</div>

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

```julia
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)

```

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [October 30, 2017, 5:04pm UTC](https://discourse.julialang.org/t/named-arguments-in-type/6780/2 "2017-10-30T17:04:13Z")

</div>

Check out the Parameters.jl package.

---

<div class="post-metadata">

**Author:** ![sysint64](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sysint64/32/2398_2.png) [@sysint64](https://discourse.julialang.org/u/sysint64)\
**Post date:** [October 30, 2017, 5:07pm UTC](https://discourse.julialang.org/t/named-arguments-in-type/6780/3 "2017-10-30T17:07:05Z")

</div>

Thanks, looks what I need
