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

Un-deprecate setindex with multidimensional indices #12290

Merged
merged 1 commit into from
Jul 27, 2015

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Jul 24, 2015

Back in #10525, I decided to deprecate setindex!(A, x, I::Union{Real, Int, AbstractArray}...) for symmetry since getindex only allows vector indices when there's more than one index.

But looking forward, I would really like to work towards APL semantics in 0.5 wherein the sum of the dimensionality of the indices is the dimensionality of the output array. For example, indexing A[[1 2; 3 4], 1] would output a 2-dimensional 2x2 array: [A[1,1] A[2, 1]; A[3,1] A[4,1]]. In which case, we'd add support back in for setindex! with array indices for symmetry. This seems like needless churn - let's just leave things be until 0.5.

Back in #10525, I decided to deprecate `setindex!(A, x, I::Union{Real, Int, AbstractArray}...)` for symmetry since `getindex` only allows vector indices when there's more than one index.

But looking forward, I would really like to work towards APL semantics in 0.5 wherein the sum of the dimensionality of the indices is the dimensionality of the output array.  For example, indexing `A[[1 2; 3 4], 1]` would output a 2-dimensional `2x2` array: `[A[1,1] A[2, 1]; A[3,1] A[4,1]]`.  In which case, we'd add support back in for `setindex!` with array indices for symmetry.  This seems like needless churn - let's just leave things be until 0.5.
JeffBezanson added a commit that referenced this pull request Jul 27, 2015
Un-deprecate setindex with multidimensional indices
@JeffBezanson JeffBezanson merged commit 2b3604f into master Jul 27, 2015
@mbauman mbauman deleted the mb/undeprecatedapl branch July 27, 2015 21:37
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