Use and Documentation of -> and =>

Newbie here.

-> and => are not in the punctuation list of the Julia documentation. Can they be added or are they not applicable for some reason?

I have gathered that -> is used to define anonymous functions and => is used to define key-value pairs in dictionaries. Are there other applications I am missing?

6 Likes

That’s exactly it! They should definitely be added.

5 Likes

Is there something I should do to facilitate their addition?

1 Like

Making a PR would be best.

I don’t know what that is.

A pull request, ie explicitly making the desired change to the documentation. See

2 Likes

While I think the link @Tamas_Papp has pointed is worth reading. I would like to be a little more specific and less overwhelming, and just point that for documentation, you can just be logged into your Github account, go to https://github.com/JuliaLang/julia/blob/master/doc/src/base/punctuation.md and click the small pencil that has a hovertext of “Fork this project and edit the file”. After this you will be making the changes in your version of the julia repository, and there will be a button somewhere to do a pull request, that is kinda of offering the changes you made in your fork (i.e., copy of the repository) to the original repository you forked. The Julia developers will be notified, they may ask some changes (that you can do by editing the file in your fork by the Github interface) and then they will aprove it and it will be merged to the original/official Julia repository.

7 Likes

Well I tried. https://github.com/JuliaLang/julia/pull/35990

I don’t know if I used the right formatting or language though.

8 Likes