# To Adopt mandatory semicolon in method calls if kwargs are passed

**URL:** <https://discourse.julialang.org/t/to-adopt-mandatory-semicolon-in-method-calls-if-kwargs-are-passed/43651>\
**Category:** Internals & Design\
**Tags:** proposal\
**Created:** [July 25, 2020, 1:56am UTC](https://discourse.julialang.org/t/to-adopt-mandatory-semicolon-in-method-calls-if-kwargs-are-passed/43651 "2020-07-25T01:56:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![josePereiro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josepereiro/32/17322_2.png) [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Post date:** [July 25, 2020, 3:42am UTC](https://discourse.julialang.org/t/to-adopt-mandatory-semicolon-in-method-calls-if-kwargs-are-passed/43651/3 "2020-07-25T03:42:35Z")

</div>

Thanks for the quick reply!

> [@yuyichao](#):
>
> and the fact that argument name is not a property of a function but that of a method.

Upps, my mistake!

> [@yuyichao](#):
>
> there isn’t any way sensible to interpret a named positional argument.

I see that this is a controversial topic, that’s why discution in [posted link](https://discourse.julialang.org/t/allow-use-of-named-argument-syntax-for-positional-arguments/5287) exist.

> [@yuyichao](#):
>
> Nope, it helps nothing there either. `new` is defined clear enough that it doesn’t need help to distinguish between positional and keyword arguement.

Yes, but I found

> [@Kwargs in new(), or safer ways of constructing immutable structs](https://discourse.julialang.org/t/kwargs-in-new-or-safer-ways-of-constructing-immutable-structs/43555/1):
>
> I find that aligning the arguments to `new()` with the order of the struct fields to be quite tedious and error prone (especially if adjacent fields have the same type, or I add / reorder types).

To have named arguments can help there too.

> [@yuyichao](#):
>
> Nope, the only issue there is dispatch

Yes, but I think a solution that do not change how dispatch works and add the features people already like from other languages can be found. What is proposed do not touch dispatch, I think?

I found in that discussion, as an example:

> [@Allow use of named-argument syntax for positional arguments?](https://discourse.julialang.org/t/allow-use-of-named-argument-syntax-for-positional-arguments/5287/42):
>
> The trouble with this is that you need to know which arguments passed with `key = val` syntax are positional and which are keyword arguments before you can choose a method. But you don’t know that until you’ve selected a method. For example, if I see `f(x = 1, y = 2, z = 3)` how do I know which subset of `x` , `y` and `z` are positional and should be used to dispatch `f` and which are keywords and should be ignored during dispatch? There are 8 = 2^3 possibilities to consider and that number grows exponentially with the number of arguments.

As the proposal say `f(x = 1, y = 2, z = 3)` will be interpreted as current call `f(1, 2, 3)` and the ambiguity is gone, just because semicolon is mandatory. To be able to optionally label positional arguments is not like REALLY important, but it is cool.

> [@yuyichao](#):
>
> If you have a plan to change that, which should be discussed in [Allow use of named-argument syntax for positional arguments?](https://discourse.julialang.org/t/allow-use-of-named-argument-syntax-for-positional-arguments/5287/50) instead

That’s ok, I just wanted to focus on the idea of make semicolon mandatory because help to solve other problems/issues

---

_[View the full topic](https://discourse.julialang.org/t/to-adopt-mandatory-semicolon-in-method-calls-if-kwargs-are-passed/43651)._
