Re: [julia-users] append! multiple collections

2016-03-20 Thread Stefan Karpinski
Yes, that would be better written to pre-extend the array only once. Another good PR/issue to open. On Wed, Mar 16, 2016 at 10:58 PM, Cedric St-Jean wrote: > Not part of Michele's PR, but I just saw this definition: > > push!(A, a, b, c...) = push!(push!(A, a, b), c...)

Re: [julia-users] append! multiple collections

2016-03-19 Thread Yichao Yu
On Thu, Mar 17, 2016 at 6:05 PM, Greg Plowman wrote: > > I apologise in advance if this is total nonsense, which it may very well be. > > However, some results I get seem to indicate that the current implementation > of push! does not always allocate. > This is

Re: [julia-users] append! multiple collections

2016-03-19 Thread Michele Zaffalon
Cedric, Feel free to contribute the PR, since you have a better understanding than I do. On Thu, Mar 17, 2016 at 2:48 PM, Stefan Karpinski wrote: > Yes, that would be better written to pre-extend the array only once. > Another good PR/issue to open. > > On Wed, Mar 16,

Re: [julia-users] append! multiple collections

2016-03-19 Thread Greg Plowman
I apologise in advance if this is total nonsense, which it may very well be. However, some results I get seem to indicate that the current implementation of push! does not always allocate. This is consistent with my understanding that growing arrays happens by doubling when necessary?? Is this

Re: [julia-users] append! multiple collections

2016-03-19 Thread Cedric St-Jean
Not part of Michele's PR, but I just saw this definition: push!(A, a, b, c...) = push!(push!(A, a, b), c...) Doesn't it make the vector reallocate+copy many times instead of just once? On Wednesday, March 16, 2016 at 9:45:02 AM UTC-4, Stefan Karpinski wrote: > > Yes, wonderful! Thanks for

Re: [julia-users] append! multiple collections

2016-03-19 Thread Stefan Karpinski
Yes, wonderful! Thanks for contributing it. If you add a test, it'll get merged rapidamente. On Wed, Mar 16, 2016 at 4:03 AM, Michele Zaffalon < michele.zaffa...@gmail.com> wrote: > Something like this ? > > On Tue, Mar 15, 2016 at 7:28 PM, Stefan

Re: [julia-users] append! multiple collections

2016-03-16 Thread Michele Zaffalon
Something like this ? On Tue, Mar 15, 2016 at 7:28 PM, Stefan Karpinski wrote: > It's just an absent feature – if you'd open an issue, I'm sure someone > will add it shortly. It would make a pretty good intro issue. > > On

Re: [julia-users] append! multiple collections

2016-03-15 Thread Stefan Karpinski
It's just an absent feature – if you'd open an issue, I'm sure someone will add it shortly. It would make a pretty good intro issue. On Tue, Mar 15, 2016 at 12:43 PM, Michele Zaffalon < michele.zaffa...@gmail.com> wrote: > I have some arrays I would like to `append!` to the first. At the moment