News/info on Go and Java

Sergey Gromov snake.scaly at gmail.com
Thu Nov 26 09:36:02 PST 2009


Thu, 26 Nov 2009 11:58:23 -0500, bearophile wrote:

> Sergey Gromov:
>>     var slice []int = array[5:7];
> 
> Is []int better than int[] ?

Well, try to read aloud int[5][10]. I come up with "Integer, five of
them, ten times."  While [10][5]int is "Array of ten arrays of
integers."  It's *much* clearer.

> [5:7] is a slice syntax a bit better than [5..7] (and it's used in
> Python). But in D [5:7] is the literal for an AA... 

In Go, it'd be map[int]int{5:7}.



More information about the Digitalmars-d mailing list