Re: [go-nuts] Re: Dynamic include path in cgo?

2020-08-09 Thread Sebastien Binet
Another possible course of action is to have all the logic of generating these lines embedded inside a 'go generate' program. That's what has been done in go-python/gopy for example. -s Original Message On Aug 10, 2020, 06:18, wrote: > On Sunday, August 9, 2020 at 9:56:43 AM

[go-nuts] Re: Dynamic include path in cgo?

2020-08-09 Thread alex . besogonov
On Sunday, August 9, 2020 at 9:56:43 AM UTC-7, Miki Tebeka wrote: > > Is there a way to pass include path dynamically to cgo? > The easiest way is to generate the include file and just reference it from cgo. It looks like your code needs to have a Makefile anyway. -- You received this message b

Re: [go-nuts] Dynamic include path in cgo?

2020-08-09 Thread Miki Tebeka
Thanks. I agree that running arbitrary code in #cgo directives is a bad idea :) I'll probably document asking to export CGO_CFLAGS="-I $(python -c 'import numpy; print(numpy.get_include())')" before running "go get" On Monday, August 10, 2020 at 4:06:54 AM UTC+3, Ian Lance Taylor wrote: > > On

Re: [go-nuts] Generics: after type lists

2020-08-09 Thread Ian Lance Taylor
On Fri, Aug 7, 2020 at 4:33 PM Patrick Smith wrote: > > I like the second draft for generics. It seems to me a large > simplification and improvement over the first draft. Considering just > the state of Go today, I would be quite happy with this, even if it's > not perfect. Thanks to Ian, Robert,

Re: [go-nuts] [proposal] Make go compiler work with different syntax versions in same project to support adaptivity

2020-08-09 Thread Ian Lance Taylor
On Sat, Aug 8, 2020 at 7:51 PM wrote: > > Add support of optional syntax_version to file beginning, allow compiler to > tokenize/compile file by the compiler of syntax_version, using any number of > syntax_version-s in same project > > Why? Because go takes ridiculously long to implement generic

Re: [go-nuts] Dynamic include path in cgo?

2020-08-09 Thread Ian Lance Taylor
On Sun, Aug 9, 2020 at 9:57 AM Miki Tebeka wrote: > > Is there a way to pass include path dynamically to cgo? > > I'm working with numpy and the way to find the include directory is to call > (in Python) > numpy.get_include() > > In a Makefile I can run go build with > CGO_CFLAGS=-I $(shell pytho

[go-nuts] Re: [proposal] Make go compiler work with different syntax versions in same project to support adaptivity

2020-08-09 Thread Viktor Kojouharov
What problems would you expect generics to bring in terms of syntax, where such flexibility would be a solution? On Sunday, August 9, 2020 at 4:51:40 AM UTC+2 ivaniva...@gmail.com wrote: > Add support of optional syntax_version to file beginning, allow compiler > to tokenize/compile file by the

Re: [go-nuts] Re: Generics: after type lists

2020-08-09 Thread Viktor Kojouharov
There's a big difference between creating arbitrary operators like c++, and just allowing the predefined set of operators to be implemented for custom types only. The later, combined with the overall aversion of the Go community towards operator overloading as a whole, will probably lead to ver

[go-nuts] Dynamic include path in cgo?

2020-08-09 Thread Miki Tebeka
Is there a way to pass include path dynamically to cgo? I'm working with numpy and the way to find the include directory is to call (in Python) numpy.get_include() In a Makefile I can run go build with CGO_CFLAGS=-I $(shell python -c 'import numpy; print(numpy.get_include())') go build but

Re: [go-nuts] "Interfaces" with type lists are a strange beast

2020-08-09 Thread robert engels
On second thought, that would lead to ‘operator overloading’ and the abuses it invites - so oh well - I guess we write duplicate methods based on types - which is pretty much what you can do now - write a base implementation using interface{} and then a small wrapper struct that types it. Given

RE: [go-nuts] golan operator

2020-08-09 Thread PH2015014 Anjana Prabhakar
Thank you Kurtis. It was a great help.  Sent from Mail for Windows 10 From: Kurtis RaderSent: 03 August 2020 10:40To: Anjana PrabhakarCc: golang-nutsSubject: Re: [go-nuts] golan operator On Sun, Aug 2, 2020 at 9:56 PM Anjana Prabhakar wrote:Dear All, Can someone help me

Re: [go-nuts] Re: go modules and local packages

2020-08-09 Thread Sankar P
> I had the same situation and this worked perfectly: > > replace mylib => ../mylib > > If it doesn't - check paths, name of the "mylib" module, etc Thanks. It worked. I strongly feel like I tried the same yesterday and it didn't work, but probably mis-typed the name in the module. -- You receiv

[go-nuts] Re: go modules and local packages

2020-08-09 Thread Space A.
I had the same situation and this worked perfectly: replace mylib => ../mylib If it doesn't - check paths, name of the "mylib" module, etc суббота, 8 августа 2020 г. в 21:20:56 UTC+3, Sankar: > Hi > > I have a monolithic source repository that is NOT in git, mercurial etc. > > The directory