www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Go updates

reply bearophile <bearophileHUGS lycos.com> writes:
Thanks to being backed by Google Go seems to improve:
http://blog.golang.org/2010/03/go-whats-new-in-march-2010.html

Go also now natively supports complex numbers.<

While D2 will unsupport them, because D2 is probably flexible enough to not need to keep them as built-ins :-)
The syntax x[lo:] is now shorthand for x[lo:len(x)].<

That's identical to the Python syntax. But the D version x[lo .. $] is acceptable. But there's a len() my dlibs too. It helps me avoid to write "length" all the time and avoids my typos, and it can be used as delegate too: map(&len, arr); This Go syntax is cute: Pointer to int: *int Array of ints: []int Array of pointer to ints: []*int Pointer to array of ints: *[]int In D it becomes: Pointer to int: int* Array of ints: int[] Array of pointer to ints: int*[] Pointer to array of ints: int[]* Here I think I like the Go version better :-( Bye, bearophile
Mar 23 2010
next sibling parent reply BLS <windevguy hotmail.de> writes:
On 24/03/2010 02:39, bearophile wrote:
 Thanks to being backed by Google Go seems to improve:
 http://blog.golang.org/2010/03/go-whats-new-in-march-2010.html

 Go also now natively supports complex numbers.<

While D2 will unsupport them, because D2 is probably flexible enough to not need to keep them as built-ins :-)
 The syntax x[lo:] is now shorthand for x[lo:len(x)].<

That's identical to the Python syntax. But the D version x[lo .. $] is acceptable. But there's a len() my dlibs too. It helps me avoid to write "length" all the time and avoids my typos, and it can be used as delegate too: map(&len, arr); This Go syntax is cute: Pointer to int: *int Array of ints: []int Array of pointer to ints: []*int Pointer to array of ints: *[]int In D it becomes: Pointer to int: int* Array of ints: int[] Array of pointer to ints: int*[] Pointer to array of ints: int[]* Here I think I like the Go version better :-( Bye, bearophile

D vs Go I do not agree If we read D from RIGHT to LEFT like Pointer to array of ints: int[]* than we have * //pointer to [] // array of int in Go From LEFT to RIGHT * [] int So Go is just a pascalized C. who cares.
Mar 23 2010
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
BLS:
 So Go is just a pascalized C. who cares.

:-) view of point your with agree fully don't I Bye, bearophile
Mar 23 2010
parent BLS <windevguy hotmail.de> writes:
On 24/03/2010 03:02, bearophile wrote:
 BLS:
 So Go is just a pascalized C. who cares.

:-) view of point your with agree fully don't I Bye, bearophile

Good point !!
Mar 23 2010
prev sibling parent Jesse Phillips <jessekphillips+D gmail.com> writes:
BLS wrote:

 On 24/03/2010 02:39, bearophile wrote:
 Thanks to being backed by Google Go seems to improve:
 http://blog.golang.org/2010/03/go-whats-new-in-march-2010.html

 Go also now natively supports complex numbers.<

While D2 will unsupport them, because D2 is probably flexible enough to not need to keep them as built-ins :-)
 The syntax x[lo:] is now shorthand for x[lo:len(x)].<

That's identical to the Python syntax. But the D version x[lo .. $] is acceptable. But there's a len() my dlibs too. It helps me avoid to write "length" all the time and avoids my typos, and it can be used as delegate too: map(&len, arr); This Go syntax is cute: Pointer to int: *int Array of ints: []int Array of pointer to ints: []*int Pointer to array of ints: *[]int In D it becomes: Pointer to int: int* Array of ints: int[] Array of pointer to ints: int*[] Pointer to array of ints: int[]* Here I think I like the Go version better :-( Bye, bearophile

D vs Go I do not agree If we read D from RIGHT to LEFT like Pointer to array of ints: int[]* than we have * //pointer to [] // array of int in Go From LEFT to RIGHT * [] int So Go is just a pascalized C. who cares.

Or: Integer pointer array: int*[] Integer array pointer: int[]* Yes when you want to make a complete sentence out of it, the order changes. Reading what it says tells the story correctly.
Mar 23 2010
prev sibling parent Norbert Nemec <Norbert Nemec-online.de> writes:
bearophile wrote:
 This Go syntax is cute:
 Pointer to int: *int
 Array of ints: []int
 Array of pointer to ints: []*int
 Pointer to array of ints: *[]int
 
 In D it becomes:
 Pointer to int: int*
 Array of ints: int[]
 Array of pointer to ints: int*[]
 Pointer to array of ints: int[]*
 
 Here I think I like the Go version better :-(

The famous case in support of Go syntax: In D syntax, a nested array int[A][B] x; has to be indexed as x[b][a] (implying that b runs over 0..B and a over 0..A) After all, it is an "array of B arrays of A integers", in other words an "integer-A-element-array-B-element-array". The same in Go ordering is more straightforward: [B][A]int x
Mar 23 2010