# \#push

**URL:** https://discourse.julialang.org/tag/push/1036.md

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

---

## [@threads in for loop and push! in if statement](https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916)

<div class="topic-metadata">

**Author:** [@Stephen](https://discourse.julialang.org/u/Stephen)\
**Replies:** 6\
**Last updated:** [January 20, 2025, 1:19am UTC](https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916 "2025-01-20T01:19:21Z")

</div>

Hello there, I’m using @threads to accelerate my for loop, I don’t know how to push! a variable in if , I ask ChatGPT, it gives the code as following: # Initialize an empty array to store symbols, shared across threads …

---

## [Add Resizable AbstractArray interface for push! and append!?](https://discourse.julialang.org/t/add-resizable-abstractarray-interface-for-push-and-append/118049)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 5\
**Last updated:** [August 11, 2024, 1:06pm UTC](https://discourse.julialang.org/t/add-resizable-abstractarray-interface-for-push-and-append/118049 "2024-08-11T13:06:28Z")

</div>

On Julia 1.10, the following AbstractVector implementation supports push! and append!: julia\> begin struct MyVector \<: AbstractVector{Int} v::Vector{Int} function MyVector(args...) …

---

## [Alternative to Any\[ \] ? or efficient usage idea?](https://discourse.julialang.org/t/alternative-to-any-or-efficient-usage-idea/116969)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 9\
**Last updated:** [July 12, 2024, 9:19pm UTC](https://discourse.julialang.org/t/alternative-to-any-or-efficient-usage-idea/116969 "2024-07-12T21:19:53Z")

</div>

Hello everyone, Im trying to avoid use of any\[\] in my code but at the moment situation is such that I need to save results for unknown number of interactions (stochastic in nature). So, I’m using any\[\] and pushing resul…

---

## [How to augment an \`Int64\` 1-D array or vector](https://discourse.julialang.org/t/how-to-augment-an-int64-1-d-array-or-vector/107729)

<div class="topic-metadata">

**Author:** [@chandra](https://discourse.julialang.org/u/chandra)\
**Replies:** 8\
**Last updated:** [December 17, 2023, 3:32pm UTC](https://discourse.julialang.org/t/how-to-augment-an-int64-1-d-array-or-vector/107729 "2023-12-17T15:32:55Z")

</div>

function continued\_fraction(num, denom) a = \[\] quo, rem = divrem(num, denom) a0 = quo push!(a, a0) num = denom denom = rem i = 1 while (rem != 0) quo, rem = divrem(num, denom) …

---

## [How does push!() work within accumulate()?](https://discourse.julialang.org/t/how-does-push-work-within-accumulate/81286)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 11:32pm UTC](https://discourse.julialang.org/t/how-does-push-work-within-accumulate/81286 "2022-05-18T23:32:58Z")

</div>

why are the two formulations of accumulate() different? accumulate((s,c)-\>push!(s,c),1:3,init=\[\]) != accumulate((s,c)-\>\[s;c\],1:3,init=\[\]) #true push!(\[1,2\],3)==\[\[1,2\];3\] # true
