# \#immutable

**URL:** https://discourse.julialang.org/tag/immutable/1450.md

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

---

## [Issue with backprop in a custom recurrent \`Lux\` layer](https://discourse.julialang.org/t/issue-with-backprop-in-a-custom-recurrent-lux-layer/128968)

<div class="topic-metadata">

**Author:** [@pietro-butti](https://discourse.julialang.org/u/pietro-butti)\
**Replies:** 6\
**Last updated:** [June 16, 2025, 3:44pm UTC](https://discourse.julialang.org/t/issue-with-backprop-in-a-custom-recurrent-lux-layer/128968 "2025-06-16T15:44:58Z")

</div>

I am trying to implement an autoencoder in Lux, inspired by the excellent one that I found in githun.com/lkulowski/LSTM\_encoder\_decoder, coded with PyTorch. (diagram taken from the link) Model overview The encoder i…

---

## [Why Are Statically Sized Arrays Immutable?](https://discourse.julialang.org/t/why-are-statically-sized-arrays-immutable/128331)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 30\
**Last updated:** [April 25, 2025, 3:06pm UTC](https://discourse.julialang.org/t/why-are-statically-sized-arrays-immutable/128331 "2025-04-25T15:06:20Z")

</div>

I often hear that StaticArrays.SArray is immutable because it is stack allocated. I’m sure this is a misunderstanding on my end, though, because stack allocated types in other languages can be mutated in other languages. …

---

## [Inplace modification of Float64](https://discourse.julialang.org/t/inplace-modification-of-float64/118995)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 4\
**Last updated:** [September 3, 2024, 3:45pm UTC](https://discourse.julialang.org/t/inplace-modification-of-float64/118995 "2024-09-03T15:45:55Z")

</div>

Hi, I know that things like Float64 are immutable, so I can’t do inplace modification (in my specific situation: I can’t call clamp! on them). I’m writing some code in which I either want to apply a routine on an entire…

---

## [Why Julia doesn't throw error if pre-declared array is reassigned to a new differently sized array?](https://discourse.julialang.org/t/why-julia-doesnt-throw-error-if-pre-declared-array-is-reassigned-to-a-new-differently-sized-array/115697)

<div class="topic-metadata">

**Author:** [@singularity](https://discourse.julialang.org/u/singularity)\
**Replies:** 16\
**Last updated:** [June 16, 2024, 2:10pm UTC](https://discourse.julialang.org/t/why-julia-doesnt-throw-error-if-pre-declared-array-is-reassigned-to-a-new-differently-sized-array/115697 "2024-06-16T14:10:29Z")

</div>

Another confusing thing with Julia. Why does julia not throw an error if I declare an array as x::Vector{Float64} = zeros(100); and then reassign as x = rand(50); How can I ensure bound-checking with this kind of fre…

---

## [Can I mimick finalizing for immutables / is an immutable file handler unfeasible?](https://discourse.julialang.org/t/can-i-mimick-finalizing-for-immutables-is-an-immutable-file-handler-unfeasible/104687)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 16\
**Last updated:** [October 15, 2023, 9:30am UTC](https://discourse.julialang.org/t/can-i-mimick-finalizing-for-immutables-is-an-immutable-file-handler-unfeasible/104687 "2023-10-15T09:30:20Z")

</div>

I can’t think of other uses for destructors/finalizers in a language without manual deallocations, so I’m using file-closing as an example. It seems to me that I could implement open to open a file and construct an immut…
