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

Functions as "Array Initializers" #48624

Open
uniment opened this issue Feb 10, 2023 · 0 comments
Open

Functions as "Array Initializers" #48624

uniment opened this issue Feb 10, 2023 · 0 comments

Comments

@uniment
Copy link

uniment commented Feb 10, 2023

(Related Discourse discussion)

This would be nice:

x = Array{Float64}(m, n) do (i, j)
    i+j
end
x == Float64[i+j for i=1:m, j=1:n] # true

If #48404 is approved, then this will work by sending a CartesianIndex as an argument.

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

No branches or pull requests

1 participant