Re: [go-nuts] Regarding contracts

2018-10-20 Thread Burak Serdar
On Sat, Oct 20, 2018 at 9:42 AM Ian Denhardt wrote: > > Quoting Burak Serdar (2018-10-19 17:01:42) > > On Fri, Oct 19, 2018 at 1:09 PM Ian Denhardt wrote: > > > > > > Quoting Burak Serdar (2018-10-19 14:09:46) > > > > > > > It is useful in a linked list. You can instantiate a linked list > > > >

Re: [go-nuts] Proposed changes to the Go draft generics design in the light of feedback received

2018-10-20 Thread alanfo
I think it's fair to say that dealing with untyped numeric constants is one of the most opaque areas of the draft design and I remember thinking when I first read it that a clearer and more intuitive solution would have to be found. As far as the 'excluded types' idea is concerned, I can't

[go-nuts] Python heapq.merge in golang using channels?

2018-10-20 Thread Jiang Long
Hello, I am quite new to golang and has been programming python and c++ for a while. I use python heapq.merge to merge sort multiple already-sorted queues in generator style. I am wondering if golang already has anything to do this, or I should somehow implement my own using priority queues?

Re: [go-nuts] Proposed changes to the Go draft generics design in the light of feedback received

2018-10-20 Thread Ian Denhardt
Quoting alan.f...@gmail.com (2018-10-20 16:59:52) >I haven't checked them all but I did notice one example which your >paper doesn't appear to cover, namely the add1K example which has been >a stumbling block for a lot of proposals including my own though I did >eventually find a

Re: [go-nuts] Avoiding overloading

2018-10-20 Thread Ian Denhardt
Quoting Andy Balholm (2018-10-20 17:34:15) > It’s just one of probably dozens of types of operations that people > will want generic types to be able to support, besides method calls and > operators. Adding support for them wouldn’t be very hard either, but by > the time you got done, the result

Re: [go-nuts] Proposed changes to the Go draft generics design in the light of feedback received

2018-10-20 Thread alan . fox6
Ian D, I'm sorry that we had a mis-understanding regarding the introduction to my paper but I hope you now understand why I made the remarks I did. To turn to the technical issues. I haven't checked them all but I did notice one example which your paper doesn't appear to cover, namely the

[go-nuts] Re: Proposed changes to the Go draft generics design in the light of feedback received

2018-10-20 Thread alanfo
Mandolyte, Pleased you liked the approach :) That's four of us now who favor changing the type parameter section from parentheses to square brackets, so we're building a bit of a consensus on that particular aspect. Alan On Saturday, October 20, 2018 at 2:31:29 PM UTC+1, Mandolyte wrote: > >

[go-nuts] Re: do you use binary-only packages?

2018-10-20 Thread jclc via golang-nuts
Currently I don't use them, but couldn't binary packages be used to distribute CGO-dependent packages for developers who might not have a C cross-compiler? I think the feature would be more commonly used if it wasn't so impractical. Rather than abandoning the feature I'd like to see it

Re: [go-nuts] Re: do you use binary-only packages?

2018-10-20 Thread Harald Weidner
Hallo, On Fri, Oct 19, 2018 at 11:45:04AM -0700, Ian Lance Taylor wrote: > > Unhelpfully, I imagine it unlikely that anyone distributing binary go > > packages reads golang-dev or golang-nuts. > > Is there a more likely place to reach such people? I believe the best ways to reach attention on

Re: [go-nuts] Avoiding overloading

2018-10-20 Thread Ian Denhardt
Quoting Andy Balholm (2018-10-20 13:30:58) > There are some contracts in the draft design that can’t be expressed with the > “implements” syntax as it stands. Some would be fairly simple syntax > extensions, but others describe the relationship between two types rather > than just the

Re: [go-nuts] Escape slashes from file path

2018-10-20 Thread Anik Hasibul
Yes! Just tried. Thanks for giving me the idea about kicking the slashes from file name. From: golang-nuts@googlegroups.com on behalf of Tamás Gulácsi Sent: Sunday, October 21, 2018 12:12:13 AM To: golang-nuts Subject: Re: [go-nuts] Escape slashes from file path

Re: [go-nuts] Escape slashes from file path

2018-10-20 Thread Tamás Gulácsi
strings.Replace(fn, "/", "-", -1) ? You can use other transcodings (quopri, base64) but those needs decoding, too. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [go-nuts] Escape slashes from file path

2018-10-20 Thread Anik Hasibul
I need the whole name :( the slash isn't separating the directory. It's "artist/track.mp3" From: golang-nuts@googlegroups.com on behalf of Tamás Gulácsi Sent: Sunday, October 21, 2018 12:00:08 AM To: golang-nuts Subject: [go-nuts] Escape slashes from file path

[go-nuts] Escape slashes from file path

2018-10-20 Thread Tamás Gulácsi
Use filepath.Base to strip the directory part. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] Re: [ANN] pygor: yet another Python to Go regurgitator

2018-10-20 Thread Nick Craig-Wood
Very interesting :-) It looks like a useful tool for producing a first rough cut of a python program. -- Nick On 20/10/18 05:16, Raffaele Sena wrote: Inspired by ESR pytogo (and tired of writing python code), I went the complete opposite way and came up with pygor:

Re: [go-nuts] Feedback from Stripe developers on Go 2 draft designs

2018-10-20 Thread Liam
I have linked the webpage for this thread on the error handling feedback wiki https://github.com/golang/go/wiki/Go2ErrorHandlingFeedback Could someone link it on the other wikis? On Wednesday, October 17, 2018 at 4:46:13 PM UTC-7, Ian Lance Taylor wrote: > > Thanks for the feedback. > > Please

Re: [go-nuts] Avoiding overloading

2018-10-20 Thread Andy Balholm
There are some contracts in the draft design that can’t be expressed with the “implements” syntax as it stands. Some would be fairly simple syntax extensions, but others describe the relationship between two types rather than just the operations on a single type. No extension of interfaces

[go-nuts] Escape slashes from file path

2018-10-20 Thread Anik Hasibul
``` { "name":"foo/bar.mp3", "url":"https://foobar.com/bar.mp3; } ``` I wanna save the song after fetching the url. When I am going to save the file to the `name` value it says `open: foo/bar.mp3 no such`, because the directory `foo` doesn't exist. I wanna save it in the current

Re: [go-nuts] Regarding contracts

2018-10-20 Thread Ian Denhardt
Quoting robert engels (2018-10-20 12:15:52) >To be clear, this is only for that "performance case", where I don't >want LinkedList to allocate internal nodes to hold the elements but the >reasoning applies when using a simple LinkedList, and I want it to hold >MyObj (which is not

Re: [go-nuts] Regarding contracts

2018-10-20 Thread robert engels
Agreed, the following is where the disconnect is > On Oct 20, 2018, at 10:40 AM, Ian Denhardt wrote: > >> // Do we need LinkedList(T)? Maybe not.. >> func (l *LinkedList) Add(n *Node) { >> n.next=nil >> if l.head==nil { >>l.head=n >> } else { >>l.head.next=n >> } >> } if I declare

[go-nuts] use cgo cross compile linux platform link error on MacOS link error

2018-10-20 Thread Tamás Gulácsi
You (practically) cannot cross-compile with cgo. Use github.com/karalabe/xgo if you have Docker. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [go-nuts] Regarding contracts

2018-10-20 Thread Ian Denhardt
Quoting Burak Serdar (2018-10-19 17:01:42) > On Fri, Oct 19, 2018 at 1:09 PM Ian Denhardt wrote: > > > > Quoting Burak Serdar (2018-10-19 14:09:46) > > > > > It is useful in a linked list. You can instantiate a linked list > > > template in a package, and use that concrete type in another package

Re: [go-nuts] Proposed changes to the Go draft generics design in the light of feedback received

2018-10-20 Thread Ian Denhardt
Quoting alan.f...@gmail.com (2018-10-19 16:19:36) >Ian D, >The introduction is certainly not intended to be insulting to those who >have put serious thought into the problem. If it were, then I'd be >insulting myself as I've put serious thought into at least two other >

[go-nuts] use cgo cross compile linux platform link error on MacOS link error

2018-10-20 Thread Weeds Qian
I have test that use GOOS=linux GOARCH=amd64 can be compiled successful in MacOS. But I encounter problem when interfere with the github.com/mattn/go-sqlite3 which need cgo, so I enable the CGO_ENABLED=1 This is where is the error happen, the error message as bellow, how can I fix it, thanks.

[go-nuts] Proposed changes to the Go draft generics design in the light of feedback received

2018-10-20 Thread Mandolyte
Alan, like your approach and nearly all your solutions (any quibbling I have isn't worth mentioning). And best of all, I think it would make excellent godoc documentation. Thanks for taking the time to write this up. -- You received this message because you are subscribed to the Google

Re: [go-nuts] Re: do you use binary-only packages?

2018-10-20 Thread Scott Cotton
Hi dharani, I don't think the bigger questions about end products or services are so much implied by the question. BOPs are just one form of binary that have some problems for users and maintainenance, and there are workarounds to supplying a package with binary dependencies that don't

Re: [go-nuts] relaxing type conversions: an "almost possible" idea with Go generics

2018-10-20 Thread 'Axel Wagner' via golang-nuts
Thank, I feel I can work with this :) On Sat, Oct 20, 2018 at 10:58 AM roger peppe wrote: > That transformation might be valid for the simple case you have there, > where there's a single parameter of exactly the interface type, but generic > functions allow much more than that. You can have

Re: [go-nuts] relaxing type conversions: an "almost possible" idea with Go generics

2018-10-20 Thread roger peppe
On Fri, 19 Oct 2018 at 22:41, Axel Wagner wrote: > As I said, I don't really understand why we disagree here - or what we are > even disagreeing about. So let me make my claim as precise as possible, in > the hope that it at least helps me understand which particular part you are > disagreeing