# \#setindex

**URL:** https://discourse.julialang.org/tag/setindex/1105.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Is it safe to broadcast \`setindex!\` with views of the same array?](https://discourse.julialang.org/t/is-it-safe-to-broadcast-setindex-with-views-of-the-same-array/133620)

<div class="topic-metadata">

**Author:** [@Sevi](https://discourse.julialang.org/u/Sevi)\
**Replies:** 4\
**Last updated:** [November 3, 2025, 4:53pm UTC](https://discourse.julialang.org/t/is-it-safe-to-broadcast-setindex-with-views-of-the-same-array/133620 "2025-11-03T16:53:25Z")

</div>

I tried to find out looking here and through the documentation, but I couldn’t find a concrete answer so far: Is it safe to re-order array elements in-place using a view into the same array, like so: julia\> A = rand(10…

---

## [Proposal: function for mutating operators?](https://discourse.julialang.org/t/proposal-function-for-mutating-operators/109707)

<div class="topic-metadata">

**Author:** [@aryavorskiy](https://discourse.julialang.org/u/aryavorskiy)\
**Replies:** 9\
**Last updated:** [February 4, 2024, 10:23pm UTC](https://discourse.julialang.org/t/proposal-function-for-mutating-operators/109707 "2024-02-04T22:23:23Z")

</div>

I want my custom type to implement indexed increments A\[...\] += B, but not assignments A\[...\] = B. Currently, syntax like A\[1:3\] += \[1, 2, 3\] is parsed A\[1:3\] = A\[1:3\] + \[1, 2, 3\]. This is straightforward, but unoptimal…

---

## [Instability with union of types with ForwardDiff and KeyedArray types, hints](https://discourse.julialang.org/t/instability-with-union-of-types-with-forwarddiff-and-keyedarray-types-hints/100772)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 1\
**Last updated:** [June 27, 2023, 8:07am UTC](https://discourse.julialang.org/t/instability-with-union-of-types-with-forwarddiff-and-keyedarray-types-hints/100772 "2023-06-27T08:07:08Z")

</div>

The goal is to calculate a number between two Vector-ish things in a type stable manner, without type assertions. This is part of a larger workflow that involves ForwardDiff.gradient, which runs, but slow, hence the inqu…

---

## [Multidimensional arrays as indices in setindex!: bug or feature?](https://discourse.julialang.org/t/multidimensional-arrays-as-indices-in-setindex-bug-or-feature/94558)

<div class="topic-metadata">

**Author:** [@Az9DBvyVLWBjs8g](https://discourse.julialang.org/u/Az9DBvyVLWBjs8g)\
**Replies:** 1\
**Last updated:** [February 13, 2023, 2:29pm UTC](https://discourse.julialang.org/t/multidimensional-arrays-as-indices-in-setindex-bug-or-feature/94558 "2023-02-13T14:29:56Z")

</div>

Hello everyone, I just found that one can use multidimensional arrays as indices within setindex!. They behave as 1d arrays, which is different from their behavior in getindex, thus the following assertion from the docs …

---

## [Check values on adding to Dict](https://discourse.julialang.org/t/check-values-on-adding-to-dict/85410)

<div class="topic-metadata">

**Author:** [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Replies:** 4\
**Last updated:** [August 7, 2022, 8:36am UTC](https://discourse.julialang.org/t/check-values-on-adding-to-dict/85410 "2022-08-07T08:36:15Z")

</div>

Apologies if this should have been obvious, but I could not find a discussion or documentation on the topic. Admittedly, its late, I’m tired, and I may just be overlooking things… The question I’m struggling with is ess…
