Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrays: fix examples for find_first and find_last #19153

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Aug 16, 2023

Fixes not working examples and suboptimal naming of array elements as arr in the two mentioned arrays module examples.

🤖 Generated by Copilot at 04d6f32

Improved the documentation of arrays.find_first and arrays.find_last by using better examples.

🤖 Generated by Copilot at 04d6f32

  • Update example code for find_first and find_last functions to use consistent and concise syntax (link, link)

@ttytm
Copy link
Member Author

ttytm commented Aug 16, 2023

Maybe omitting a return keyword like the current exemples imply is a feature that could be supported - rust like. Is it something that was already discussed somewhere?

@spytheman
Copy link
Member

spytheman commented Aug 16, 2023

We plan to support a short fn expression syntax:
|i| i==3 instead of fn (i int) bool { return i == 3}, in callexprs, for functions that expect callbacks.

See: https://discord.com/channels/592103645835821068/700746775962714232/1126130868298194975

@spytheman spytheman merged commit 6df8ca2 into vlang:master Aug 17, 2023
42 checks passed
@ttytm ttytm deleted the fix/arrays-exampes branch August 22, 2023 13:32
Wertzui123 pushed a commit to Wertzui123/v that referenced this pull request Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants