Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread 'Dan Kortschak' via golang-nuts
I look forward to the addition of the definition of "in a handwavy sense" to the spec. On Thu, 2020-04-23 at 11:41 -0700, Michael Jones wrote: > You could extend the notation: > > If r 13+- { > // if r is close to 13, in a handwavy sense > : > } > > On Thu, Apr 23, 2020 at 9:43 AM Ian Lance

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread 'Dan Kortschak' via golang-nuts
Yes, sorry. Eight years of habit is hard to break. I think I agree with you; a small bit of text in https://golang.org/ref/spec#Type_definitions linking to https://golang.org/ref/spec#Predeclared_identifiers and saying that there exist already defined types may ease this, or the suggestion you

Re: [go-nuts] Should an assignment from int to a type based on int succeed?

2020-05-09 Thread 'Dan Kortschak' via golang-nuts
In https://golang.org/ref/spec#Types a Type is defined in terms of a TypeName a TypeLit or a (Type). A TypeName is what makes a type a named type. This is defined as either an identifier or a qualified identifier. For the discussion here we can ignore the latter. An identifier contains letters and

Re: [go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-26 Thread 'Dan Kortschak' via golang-nuts
On Tue, 2020-05-26 at 16:26 +1000, Jesse McNelis wrote: > On Tue, May 26, 2020 at 3:37 PM Paul Jolly wrote: > > > Why the output of this code is nondeterministic? > > > > See https://golang.org/ref/spec#For_statements, specifically the > > "For > > statements with range clause" subheading,

Re: [go-nuts] net.go ok function's c != nil check right ?

2020-06-03 Thread 'Dan Kortschak' via golang-nuts
It's perfectly valid to call a method on a nil receiver, so long at the nil receiver is not dereferenced. https://play.golang.org/p/Z-zXlj0-eVy On Wed, 2020-06-03 at 00:03 -0700, apmat...@gmail.com wrote: > Read function at net.go is like this: > > func (c *conn) Read(b []byte) (int, error) {

Re: [go-nuts] compress/bzip2:Why is there only a decompression function, no compression function.

2020-06-08 Thread 'Dan Kortschak' via golang-nuts
Also see https://godoc.org/github.com/dsnet/compress/bzip2 and https://github.com/dsnet/compress/issues/58 On Mon, 2020-06-08 at 13:14 -0400, Sam Whited wrote: > See: https://github.com/golang/go/issues/4828 > > On Mon, Jun 8, 2020, at 05:09, lziqia...@gmail.com wrote: > > Why is there no bzip2

Re: [go-nuts] compress/bzip2:Why is there only a decompression function, no compression function.

2020-06-08 Thread 'Dan Kortschak' via golang-nuts
bzip2 compression is not trivial so making sure the review catches any issues will take time. Finding people with the relevant expertise and the time to do the review is not necessarily easy. Note that you can use the dsnet package. On Mon, 2020-06-08 at 18:55 -0700, lziqia...@gmail.com wrote: >

Re: [go-nuts] political fundraising on golang.org!

2020-06-14 Thread 'Dan Kortschak' via golang-nuts
In the context of a sufficiently large collection of people all actions are political to some degree, *including inaction and non-comment*. Where the boundary is for the degree on what constitutes a political action and what doesn't varies between people. On Sun, 2020-06-14 at 16:44 -0400, Eric

[go-nuts] generics and absence of ability to specify correlated types

2020-06-17 Thread 'Dan Kortschak' via golang-nuts
Since this has come up again in [1], I would like to re-raise the issue of being able to correlate float and complex types so that a func(float32) complex64/func(float64) complex128-like function can be written generically. This issue was raised in [2] in the last round of generics discussions

Re: [go-nuts] Re: go get with vanity import path and 404: fails

2020-06-20 Thread 'Dan Kortschak' via golang-nuts
Thanks to Tim and Eric Bajumpaa on slack. The issue was due to an error in minification where the quotes around the name attribute value are stripped. Turning off minification is an interim workaround while that is broken. Dan On Sat, 2020-06-20 at 18:10 -0700, Tim Heckman wrote: > Closing the

Re: [go-nuts] Re: go get with vanity import path and 404: fails

2020-06-21 Thread 'Dan Kortschak' via golang-nuts
As a follow-up to the follow-up, I have filed golang.org/issue/39748; the error is apparently not in minification, but in the go command's handling of html. The workaround remains the same. On Sun, 2020-06-21 at 03:23 +, Dan Kortschak wrote: > Thanks to Tim and Eric Bajumpaa on slack. > >

Re: [go-nuts] generics and absence of ability to specify correlated types

2020-06-18 Thread 'Dan Kortschak' via golang-nuts
With the multitude of answers for use of alternative syntaxes for specifying type parameter lists, is there a chance that this concern could be addressed? thanks Dan On Wed, 2020-06-17 at 11:24 +, 'Dan Kortschak' via golang-nuts wrote: > Since this has come up again in [1], I would l

[go-nuts] go get with vanity import path and 404: fails

2020-06-20 Thread 'Dan Kortschak' via golang-nuts
Yesterday we replaced the old gonum.org site with a new hugo build. This appears to have broken go get for clients that do not use proxy.golang.org or some other proxy that already has gonum.org/... cached (this includes gddo). ``` $ GOPROXY=direct go get gonum.org/v1/gonum go get

Re: [go-nuts] Re: pure-go implementation of sqlite

2020-06-16 Thread 'Dan Kortschak' via golang-nuts
This is at https://modernc.org/sqlite now, along with the rest of Jan's amazing things, https://gitlab.com/cznic. On Tue, 2020-06-16 at 12:27 -0700, Mandolyte wrote: > SQLite3 support is the stated goal of > https://github.com/elliotchance/c2go > > Also, I believe I tested this one a long time

Re: [go-nuts] Bitstring package?

2020-06-29 Thread 'Dan Kortschak' via golang-nuts
Probably math/big.Int will do what you want. Dan On Mon, 2020-06-29 at 18:58 -0700, hardconnect@gmail.com wrote: > I'm looking for a package that implements arbitrary length bit > strings and > supports set all, clear all, set and reading back of arbitrary bits > and setting and clearing

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread 'Dan Kortschak' via golang-nuts
On Tue, 2020-07-14 at 23:05 -0700, Bakul Shah wrote: > I don't much like square brackets or angle brackets or guillemets. > But here is a different way > of reducing the need for parentheses at least for the common case: > > A proposal for fewer irritating parentheses! > > One thing to note

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread 'Dan Kortschak' via golang-nuts
On Tue, 2020-07-14 at 23:53 -0700, Randall O'Reilly wrote: > So, essentially, this puts the onus back on the parser programmers to > definitively *rule out* the use of < > -- is it really that difficult > / costly to do a bit of look-ahead and disambiguate the different use > cases? The absence

[go-nuts] retaining mapiterkey return values in *reflect.MapIter

2020-06-30 Thread 'Dan Kortschak' via golang-nuts
Is there a reason not to retain the returned value from `mapiterkey` on line 1243 of reflect/value.go[1] for use on line 1249[2]. ``` // Key returns the key of the iterator's current map entry. func (it *MapIter) Key() Value { if it.it == nil { panic("MapIter.Key called

Re: [go-nuts] retaining mapiterkey return values in *reflect.MapIter

2020-06-30 Thread 'Dan Kortschak' via golang-nuts
actually leaning towards the similarity being a benefit and one that would be broken by retaining the value. Dan On Tue, 2020-06-30 at 19:24 -0700, Ian Lance Taylor wrote: > On Tue, Jun 30, 2020 at 6:39 PM 'Dan Kortschak' via golang-nuts > wrote: > > > > Is there a reason not to r

Re: [go-nuts] A question about copying

2020-07-25 Thread 'Dan Kortschak' via golang-nuts
On Sat, 2020-07-25 at 01:09 -0700, chri...@surlykke.dk wrote: > &(*f1) > > would, first, create a copy of *f1, and then a pointer to that copy, > but evidently f2 becomes a pointer to the same struct as f1. Is this > something I should have deduced from the language spec? &(*p) says "give me

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread 'Dan Kortschak' via golang-nuts
On Wed, 2020-07-15 at 18:09 -0700, lotus.developer.mas...@gmail.com wrote: > Personally think this way is easier to read. In this way, I wrote a > few examples, which may be different from the creator Please post in unstyled plain text. It is almost impossible to read the code examples you have

Re: [go-nuts] Re: Generics and parentheses

2020-07-17 Thread 'Dan Kortschak' via golang-nuts
On Fri, 2020-07-17 at 15:56 -0700, Jay Kay wrote: > How about a "-generics" compile flag that lets you select one pair > from a character set of [ ( { < « . This hits two of the things that Go doesn't do: 1. proliferation of compiler option flags 2. enabling dialect spliting -- You

Re: [go-nuts] Re: Generics and parentheses

2020-07-16 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2020-07-16 at 13:44 -0700, jpap wrote: > Notwithstanding a concise unambiguous alternative, I would rather > type parameters "stick out" so they are easily identified when > visually scanning through code. func ᕙ(⇀ X ↼‶)ᕗ GenericFunction(x X) ... -- You received this message because

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread 'Dan Kortschak' via golang-nuts
On Wed, 2020-07-15 at 14:36 -0700, Randall O'Reilly wrote: > And the use of [ ] in map is more semantically associated with its > conventional use as an element accessor in arrays / slices, not with > some more general kind of type parameter. The [] syntax can be viewed as an indexing operation

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread 'Dan Kortschak' via golang-nuts
On Wed, 2020-07-15 at 15:27 -0700, Bakul Shah wrote: > The second issue is the usage for generic functions. Contrast > > (float64, int)PowN(1.2, 3) > with > PowN[float64, int](1.2, 3) > or currently > PowN(float64, int)(1.2, 3) > > I find the alternate syntax easier because

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread 'Dan Kortschak' via golang-nuts
On Wed, 2020-07-15 at 17:10 -0500, Seebs wrote: > That said, if people don't like square brackets, I'm totally prepared > to make worse suggestions until they give up and say square brackets > aren't that bad. > Let's bring back the special five keywords! func despiteallobjections F insofaras

Re: [go-nuts] A few thoughts on type parameters

2020-08-03 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2020-08-03 at 10:45 -0700, Ian Lance Taylor wrote: > Another possibility is constraints.Any, although that is no shorter > than interface{}. I'm not sure _ is best; currently _ fairly > consistently means "ignore this value," but in this usage it would > mean something different. Another

Re: [go-nuts] gophers analysing genomes

2020-08-06 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2020-08-06 at 07:41 +, Sebastien Binet wrote: > ‐‐‐ Original Message ‐‐‐ > On Thursday, August 6, 2020 9:16 AM, 'Dan Kortschak' via golang-nuts > wrote: > > > The genome of the New Zealand 'lizard', the tuatara[1], has just > > been > > sequenc

Re: [go-nuts] How to print arrays with commas and brackets

2020-08-07 Thread 'Dan Kortschak' via golang-nuts
On Wed, 2019-10-09 at 06:02 -0700, Nalin Pushpakumara wrote: > Hi, > I tried to print array with brackets and commas in golang. I want to > get > array like this. > ["record1", "record2". "record3"] > > Does anyone know how to do it? > > Thank you > Not the most efficient, but simple and

[go-nuts] gophers analysing genomes

2020-08-06 Thread 'Dan Kortschak' via golang-nuts
The genome of the New Zealand 'lizard', the tuatara[1], has just been sequenced and published in Nature[2,3]. The analysis of the genome included an examination of the repetitive sequences within the genome. The engine for finding novel repeats for this analysis is written in Go. Gophers analyse