Re: [go-nuts] Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Wojciech S. Czarnecki
Dnia 2021-02-06, o godz. 12:24:59 Martin Schnabel napisał(a): > > A "remove element from _slice_" operation always must make a new array > > and copy all elements that you intend to stay. Current idiom using append > > will do this for you while being frank about costs. > Maybe I

Re: [go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Jan Mercl
On Sat, Feb 6, 2021 at 8:01 PM Axel Wagner wrote: > FTR, I think even a library function that is defined as "the equivalent of > `append(a[:i], a[j:]...)`" (for example) would provide value. Yes, but IMO a net negative value. Many people will then mindlessly just use this O(n) variant even

Re: [go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread 'Axel Wagner' via golang-nuts
FTR, I think even a library function that is defined as "the equivalent of `append(a[:i], a[j:]...)`" (for example) would provide value. That being said, I also think having this discussion now seems pointless. Any of it will clearly not happen before generics land (or are rejected), which is

Re: [go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Jan Mercl
On Sat, Feb 6, 2021 at 5:36 PM Sean wrote: > I think there is definitely a need for a built-in "remove" function for > arrays and slice. > Everyone is writing their own implementation for this, it is both confusing > and "x = append(a[:x], b[x:])" like blablabla is not readable. Please define

[go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Sean
I think there is definitely a need for a built-in "*remove*" function for arrays and slice. Everyone is writing their own implementation for this, it is both confusing and "x = append(a[:x], b[x:])" like blablabla is not readable. 5 Şubat 2021 Cuma tarihinde saat 02:55:36 UTC+3 itibarıyla

Re: [go-nuts] Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Kevin Chadwick
>> > >> > A "remove element from _slice_" operation always must make a new >array >> > and copy all elements that you intend to stay. Current idiom using >append >> > will do this for you while being frank about costs. >> >> Maybe I misunderstand what you wrote, but as long as the slice has >>

[go-nuts] SFTPGo 2.0.0 Released

2021-02-06 Thread Nicola Murino
Hi all, I'm pleased to announce SFTPGo 2.0.0! SFTPGo is a fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support, written in Go. It can serve local filesystem, S3 (compatible) Object Storage, Google Cloud Storage, Azure Blob Storage, other SFTP servers.

Re: [go-nuts] Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Arnaud Delobelle
On Sat, 6 Feb 2021 at 11:25, Martin Schnabel wrote: > > > > On 06.02.21 03:32, Wojciech S. Czarnecki wrote: > > Dnia 2021-02-04, o godz. 00:30:57 > > Selahaddin Harmankaya napisał(a): > > > >> There are obviously more things to consider > > > > Slice is not an array, it is a _view_into_ an

Re: [go-nuts] Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Martin Schnabel
On 06.02.21 03:32, Wojciech S. Czarnecki wrote: Dnia 2021-02-04, o godz. 00:30:57 Selahaddin Harmankaya napisał(a): There are obviously more things to consider Slice is not an array, it is a _view_into_ an array. Many such views into the same array may exist simultaneously. A "remove