Re: [go-nuts] Efficient bitmask twiddling

2020-09-02 Thread Aleksey Tulinov
https://godbolt.org/z/6n7G8q I'm actually not sure how good this assembly is, it would be interesting to hear from you, but it looks promising. вт, 1 сент. 2020 г. в 22:54, Oliver Smith : > > In the process of developing a piece of middleware, I need to translate from > a bit-array into a

Re: [go-nuts] A question about copying

2020-07-25 Thread Aleksey Tulinov
You are probably thinking about code like this: var f2 = *f1 Which will make a copy, although not because `f1` is dereferenced, but because `=` was called on a value. Dereferencing a pointer gives a reference to the same value, taking address of the same value will produce a pointer to the same

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-23 Thread Aleksey Tulinov
г. в 09:16, Ian Lance Taylor : > > On Wed, Jul 22, 2020 at 9:41 PM Aleksey Tulinov > wrote: > > > > This is Java-style inheritance. It isn't bad, but i think that > > C++-style composition is somehow more in the spirit of Go. Strictly > > personal opinion of

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Aleksey Tulinov
I'm not sure if i understood everything correctly. type structField(type T) struct { a int x T } But this is a generic type, not a constraint for a type, isn't it? Constraint is this: type Custom interface{ type int, float64, uint64 } type structField(type T Custom) interface {

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Aleksey Tulinov
track of this, this is a much needed feature. Thank you for looking into this. чт, 23 июл. 2020 г. в 00:21, Ian Lance Taylor : > > On Wed, Jul 22, 2020 at 1:46 PM Aleksey Tulinov > wrote: > > > > I'm not really a language designer and i don't use Go extensively, so > > ple

[go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Aleksey Tulinov
Hi, I'm not really a language designer and i don't use Go extensively, so please take my words with a grain of salt. But I like Go and would like to use it, and I'd like to put my 2 cents into the jar. I'm sorry if this was already discussed, I checked the mailing list but didn't find this. I've