Go updates

bearophile bearophileHUGS at lycos.com
Tue Mar 23 18:39:34 PDT 2010


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



More information about the Digitalmars-d mailing list