Skip to content

Conversation

@adwasser
Copy link

@adwasser adwasser commented Apr 4, 2024

Added a description of "anonymous arguments" in the methods section of the manual, based on this forum discussion:

https://discourse.julialang.org/t/defining-methods-without-binding-variables/112485

This PR chooses a name for the pattern of defining methods without binding values to variables ("anonymous arguments"), and it describes the use of this pattern.

Someone with a better understanding of the intention of this functionality should review this, as I'm writing it from the perspective of a user rather than a developer.

Added a description of "anonymous arguements" in methods.
@ViralBShah ViralBShah added the docs This change adds or pertains to documentation label Apr 4, 2024
### Methods with anonymous arguments

Methods can be defined with anonymous arguments, where the value of the argument is not bound to a variable.
This pattern can be helpful for indicating that the behavior of the function with respect to that argument only depends on the type of the input and not its value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe wrap this line (I think generally lines should have < 100 chars, though I am not sure if this is a written rule; but it is certainly something the rest of this file adheres to).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@adwasser
Copy link
Author

adwasser commented Aug 6, 2024

@fingolfin, are you or somebody else able to merge this PR?

@ViralBShah
Copy link
Member

Should we merge?

@ViralBShah
Copy link
Member

@KristofferC ok to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs This change adds or pertains to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants