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

document range operation for array initialization #230

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

eightfilms
Copy link
Contributor

Found this neat trick on discord but it isn't in the docs, thought it might be useful - feel free to close otherwise

Yep.
[?]int{0..<16 = 123}
But note that if you want a slice, you'll probably need to do an explicit copy, or slice.fill

https://discord.com/channels/568138951836172421/568871298428698645/1269783875459088436

content/docs/overview.md Outdated Show resolved Hide resolved
@Kelimion Kelimion merged commit dc3ac1e into odin-lang:master Aug 29, 2024
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.

3 participants