Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread Ian Lance Taylor
On Sat, Oct 22, 2016 at 6:40 PM, T L wrote: > > On Saturday, October 22, 2016 at 11:59:55 PM UTC+8, Ian Lance Taylor wrote: >> >> On Sat, Oct 22, 2016 at 2:01 AM, T L wrote: >> > >> > On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: >> >> >>

[go-nuts] Re: Go Operator Precedence

2016-10-22 Thread tungcheungleong
I would recommend you use bracket no matter on which language, then people from different language can understand it without risk On Sunday, 6 May 2012 18:34:10 UTC-4, ianeperson wrote: > > The operator precedence in Go is not only shorter than that for C (C+ > +, and their various derivatives),

[go-nuts] A simple question - Can C++ and goLang coexist in the same ecosystem?

2016-10-22 Thread carlosmf . pt
C++ is evolving. C++14 is out and used in production. C++17 is almost ready. I want to invest some time in goLang, mainly because I wanted to substitute Python with a more efficient language for quick prototype implementation. Also, goLang seems to be interesting for services were performance is

Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread T L
On Saturday, October 22, 2016 at 11:59:55 PM UTC+8, Ian Lance Taylor wrote: > > On Sat, Oct 22, 2016 at 2:01 AM, T L > wrote: > > > > On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: > >> > >> > >> The string struct used internally is > >> > >> type

Re: [go-nuts] allow {3}, {true} etc

2016-10-22 Thread Nate Finch
I'd much rather have syntax that just works rather than another built-in function. On Sat, Oct 22, 2016, 6:17 PM roger peppe wrote: > When I need to do this, I find it's only a very minor annoyance to define: > > func newInt(i int) { return } > > If Go ever got

Re: [go-nuts] allow {3}, {true} etc

2016-10-22 Thread roger peppe
When I need to do this, I find it's only a very minor annoyance to define: func newInt(i int) { return } If Go ever got generics, this would probably be trivial to write generically, for example: func Ref[T](x T) *T { return } I don't think I'd object if we added a new builtin

Re: [go-nuts] Re: Golang should have a center packages index hosting like npm, rust crates

2016-10-22 Thread Keith Rarick
On Thu, Oct 20, 2016 at 1:43 AM Dave Cheney wrote: T L, I often hear this comment when a central repo for Go is proposed/suggested/requested. Are you able to give details of the things you do not like about Maven/npm/rubygems central repos. The most specific the better please.

[go-nuts] ARM server board

2016-10-22 Thread Tharaneedharan Vilwanathan
Hi All, I am looking for a server type board with 64-bit ARM and more RAM (>2GB) that runs Ubuntu or similar. I want to run Go code in it. It shouldn't cost > $400. Any suggestions? Thanks dharani -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: Serialization internal data to disk

2016-10-22 Thread Kiki Sugiaman
Gob helps with (de)serializing data structures. mapset.Set is an interface. It doesn't help that the underlying data structure that the interface points to is unexported, hence it can only be registered with gob by the package itself. If the package doesn't do that, the package user can't do

Re: [go-nuts] allow {3}, {true} etc

2016-10-22 Thread tylerbunnell
I agree that a spoonful of syntactic sugar would be wonderful here, though I don't have any strong opinions on what form it should take. On Saturday, October 22, 2016 at 12:31:58 PM UTC-6, Pietro Gagliardi (andlabs) wrote: > > > On Oct 22, 2016, at 2:19 PM, Matt Harden >

Re: [go-nuts] allow {3}, {true} etc

2016-10-22 Thread Pietro Gagliardi
> On Oct 22, 2016, at 2:19 PM, Matt Harden wrote: > > and [...]int{5}[:] is also illegal (slice of unaddressable value) []int{5} will do the same thing, and I didn't know this until recently but the spec is written such that this even works with named indices:

Re: [go-nuts] allow {3}, {true} etc

2016-10-22 Thread Matt Harden
Interesting - &[]int{5}[0] works, but &[...]int{5}[0] doesn't, and [...]int{5}[:] is also illegal (slice of unaddressable value). I guess I always thought of []T{x,y,z} as sugar for [...]T{x,y,z}[:] but it's more like func()[]T{a := [...]T{x,y,z}; return a[:]}() I agree these are horrible. I just

[go-nuts] Add sql.NullTime type

2016-10-22 Thread Dima Kurguzov
sql package supports most language primitives (bool, int64, float64, string). I think time.Time must be supported too with sql.NullTime type - it's a nonsense to have databases with timestamps (e.g. standard created_at, updated_at columns). You may find NullTime example code in the playground

Re: [go-nuts] Re: Serialization internal data to disk

2016-10-22 Thread Tong Sun
On Sat, Oct 15, 2016 at 3:17 PM, Tong Sun wrote: > Hi, > > Need help again. > > I got everything tested out correctly, in https://github.com/suntong/ > lang/blob/master/lang/Go/src/ds/PersistentData-GOB.go, but when I tried > to apply it to my real case (more complicated data structure), it

Re: [go-nuts] allow {3}, {true} etc

2016-10-22 Thread Nate Finch
Which is effectively the same as my proposal, except horrible. On Sat, Oct 22, 2016, 12:18 PM Ian Lance Taylor wrote: > > You can, of course, write > p3 := &({5}).i > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] allow {3}, {true} etc

2016-10-22 Thread Ian Lance Taylor
On Sat, Oct 22, 2016 at 8:42 AM, Matt Harden wrote: > I don't like the syntax {0} because int is not a compound type, but > (0) seems reasonable syntax to me. I do think there is an irregularity > in the language here: > > type Int struct{i int} > anInt := Int{5} > p1 :=

Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread Ian Lance Taylor
On Sat, Oct 22, 2016 at 2:01 AM, T L wrote: > > On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: >> >> >> The string struct used internally is >> >> type stringStruct struct { >> str unsafe.Pointer >> len int >> } >> >> When following f function is called

[go-nuts] Re: A question, simple for go team

2016-10-22 Thread T L
On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: > > > The string struct used internally is > > type stringStruct struct { > str unsafe.Pointer > len int > } > > When following f function is called and s is cleared, > how do go runtime knows the starting memory address of

[go-nuts] A question, simple for go team

2016-10-22 Thread T L
The string struct used internally is type stringStruct struct { str unsafe.Pointer len int } When following f function is called and s is cleared, how do go runtime knows the starting memory address of the old s.str is "a" instead of "c"? var s = "abcdefg"[2:5] // s.str should point