[documentation] Questions about the use of semicolon

I’ve 2 questions regarding the use of semicolon:

  • I remember a few releases ago, if you have variables with the same name as function named arguments, you may omit the foo=foo like
    x = 1
    f(a; x) = a+x
    f(10; x)
    

as a shorthand for f(10,x=x). Since what version is such syntax supported? I cannot seem to find it by glancing through the recent news.md;

  • Another thing I’m tring to find in the documentation, regarding the named tuple: how is the semicolon used? I know in latest version (;) now returns an empty tuple (documented in news.md), but I cannot find it in the documentation about:
    • e.g. (; a = 1) to create a named tuple with just one key as an alternative to (a = 1,)
    • e.g. merge two named tuple without using the merge function with
    p = (x=1, y=2)
    q = (;p..., z=3)
    

Any pointers about where such use is documented? Thanks!

1 Like

For the first question: Julia 1.5 Highlights

3 Likes