Re: [go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Ian Lance Taylor
On Thu, Jan 27, 2022 at 1:38 PM Manlio Perillo wrote: > > On Thu, Jan 27, 2022 at 10:00 PM Ian Lance Taylor wrote: > > > > On Thu, Jan 27, 2022 at 3:13 AM Manlio Perillo > > wrote: > > > > > > On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: > > [...] > > > Here is an al

Re: [go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
On Thu, Jan 27, 2022 at 10:00 PM Ian Lance Taylor wrote: > > On Thu, Jan 27, 2022 at 3:13 AM Manlio Perillo > wrote: > > > > On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: > [...] > > Here is an alternate implementation: > > https://gotipplay.golang.org/p/mGm8DkqkuAX >

Re: [go-nuts] generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
On Thu, Jan 27, 2022 at 9:57 PM Ian Lance Taylor wrote: > > On Thu, Jan 27, 2022 at 2:42 AM Manlio Perillo > wrote: > > > > Consider this example, adapted from > > https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints > > (note that the e

Re: [go-nuts] Proposal: write a Go Type Parameters Reference document

2022-01-27 Thread Ian Lance Taylor
On Thu, Jan 27, 2022 at 1:45 AM Manlio Perillo wrote: > > Go generics are complex. > Currently the only useful documentation (excluding the Go Language > Specification) is the original design: > golang.org/design/43651-type-parameters. > > I propose to fork the design document to create a new d

Re: [go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Ian Lance Taylor
On Thu, Jan 27, 2022 at 3:13 AM Manlio Perillo wrote: > > On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: >> >> Consider this example, adapted from >> https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints >> (note t

Re: [go-nuts] generic function with a pointer parameter

2022-01-27 Thread Ian Lance Taylor
On Thu, Jan 27, 2022 at 2:42 AM Manlio Perillo wrote: > > Consider this example, adapted from > https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints > (note that the example is incorrect): > https://gotipplay.golang.org/p/a8fHVTUpeie > > T

[go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
In your implementation, p type is no longer generic. Manlio On Thursday, January 27, 2022 at 6:29:25 PM UTC+1 clemento...@gmail.com wrote: > Hello > Check this > > https://gotipplay.golang.org/p/d7nq2OV82Nv > > > On Thursday, January 27, 2022 at 12:12:50 PM UTC+1 manlio@gmail.com > wrote:

[go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Clem Clem
Hello Check this https://gotipplay.golang.org/p/d7nq2OV82Nv On Thursday, January 27, 2022 at 12:12:50 PM UTC+1 manlio@gmail.com wrote: > On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: > >> Consider this example, adapted from >> https://github.com/golang/proposal/

[go-nuts] Re: Running golangci-lint run for various different files

2022-01-27 Thread Tamás Gulácsi
Just as with other tools, golangci-lint run runs on packages, not individual files: golangci-lint run ./app ./utils/db Beginner a következőt írta (2022. január 26., szerda, 18:08:28 UTC+1): > Hey when i run golangci-lint run app/main.go utils/db/db.go i get an > error stating `named files

Re: [go-nuts] gollvm build failed

2022-01-27 Thread 'Than McIntosh' via golang-nuts
Hello, As I understand it FreeBSD doesn't have any concept of a build essentials package, so in theory /usr/include/malloc.h should always be installed. Are you saying that this file doesn't exist on your system? Thanks, Than On Thu, Jan 27, 2022 at 5:38 AM T Odin wrote: > I'm trying to build

[go-nuts] Re: generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: > Consider this example, adapted from > https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints > > (note that the example is incorrect): > https://gotipplay.golang.org

Re: [go-nuts] generic function with a pointer parameter

2022-01-27 Thread Jan Mercl
On Thu, Jan 27, 2022 at 11:42 AM Manlio Perillo wrote: > What is the reason why the code does not compile? I cannot answer your question, but just noting that this compiles and executes fine: https://gotipplay.golang.org/p/wveI2JzIxSr -- You received this message because you are subscribed to

[go-nuts] generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
Consider this example, adapted from https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints (note that the example is incorrect): https://gotipplay.golang.org/p/a8fHVTUpeie The compiler reports an error: ./prog.go:14:9: p.x undefined (type *

[go-nuts] gollvm build failed

2022-01-27 Thread T Odin
I'm trying to build gollvm on FreeBSD 13 using the command as mentioned in gollvm source page. *cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold -G Ninja ../llvm-project/llvm * I observed that during configuration it fails for malloc *Looking for malloc/malloc.hLooking for malloc/malloc.

[go-nuts] Proposal: write a Go Type Parameters Reference document

2022-01-27 Thread Manlio Perillo
Go generics are complex. Currently the only useful documentation (excluding the Go Language Specification) is the original design: golang.org/design/43651-type-parameters. I propose to fork the design document to create a new document "Go Type Parameters Reference" and publish it in https://go

Re: [go-nuts] Go 1.18, generics and fuzz testing

2022-01-27 Thread Kamil Ziemian
Thank you for information. There is so many things about Go and its tool chain that I need to learn and think about. Best regards, Kamil czwartek, 27 stycznia 2022 o 01:22:36 UTC+1 Ian Lance Taylor napisał(a): > On Wed, Jan 26, 2022 at 4:17 PM Kamil Ziemian wrote: > > > > I accidentally initial

Re: [go-nuts] Type Parameters Proposal: constraint.Number should be replaced with constraints.Integer in the examples

2022-01-27 Thread Manlio Perillo
On Friday, January 21, 2022 at 11:25:13 PM UTC+1 Ian Lance Taylor wrote: > > Another issue is the implementation of AbsoluteDifference, in > golang.org/design/43651-type-parameters#absolute-difference. > > The code is invalid due to #45639, but I suspect that the suggestion to > use a struct >

[go-nuts] Re: scripting in Go

2022-01-27 Thread Christoph Berger
Thanks for adding a long-name variant! Indeed I feel the code is much more self-documenting this way. But in the end it is only a matter of getting used to an API. Power users of "sc" will certainly be able to read the original short-name variant without problems. On Thursday, January 27, 2022