# 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:** 2

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [July 25, 2020, 2:58am UTC](https://discourse.julialang.org/t/to-adopt-mandatory-semicolon-in-method-calls-if-kwargs-are-passed/43651/2 "2020-07-25T02:58:11Z")

</div>

Requiring a semicolon helps nothing here.

> [@josePereiro](#):
>
> So, what changes?  
> Well, now you can add some requested features like
> 
> > [@](#):
> >
> > I’m fond of naming my arguments for readability. Is there a structural reason that one cannot use the names of arguments when the function defines they as positional? In other words, is there a technical reason I can’t do: f = function(the\_number\_I\_print; how\_many\_times\_I\_print=1) for i in 1:how\_many\_times\_I\_print println(the\_number\_I\_print) end end # OK f(2) # Not ok… f(the\_number\_I\_print=2) So long as one abides by things like no positional arguments after keyword…

Nope, the only issue there is dispatch, and the fact that argument name is not a property of a function but that of a method. It’s impossible to do without keyword argument.

> [@josePereiro](#):
>
> or help in situations like
> 
> > [@](#):
> >
> > When creating an immutable struct with a reasonable number of fields and an inner constructor, 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). With a mutable struct, I tend to do the following: ret = new() ret.x = x ret.y = y ret.z = z … return ret Which is much safer and easier to maintain. Does anyone have a nice approach to this? It seems like n…

Nope, it helps nothing there either. `new` is defined clear enough that it doesn’t need help to distinguish between positional and keyword arguement. Implementing it requires quiet a bit of change but this isn’t one of them.

> [@josePereiro](#):
>
> If the semicolons are mandatory, now, **because the caller will explicitly say what it is a positional or an optional parameter** you will be able to have `fun` calls like:

No, again, the issue is dispatch.

* * *

And to make it more clear, `;` is optional in the call for keyword argument simply because there isn’t any way sensible to interpret a named positional argument. If you have a plan to change that, which should be discussed in [Allow use of named-argument syntax for positional arguments? - #50 by akdor1154](https://discourse.julialang.org/t/allow-use-of-named-argument-syntax-for-positional-arguments/5287/50) instead, requiring `;` in some cases is literally the easist step to take. Without it, there’s zero reason to do any syntax change that has no purpose…

All the current “equivalent to” you show are syntactic transformation. Most of what you are proposing are not. They all require knowledge of the callee and that’s simply impossible.

---

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