Re:Go is amazing, period.
by Symmetry on Monday March 19, 2012 @09:48AM
(#3723878)
Why on Earth would you want 64 bit ints by default, though? I'm not sure why they are thinking about changing it.
[ Parent
| on HN ]
ints are used in the definition of some of the core interfaces. This has implications on how many entries a collection (that implements these interfaces) can contain.
For example, sort.Interface:
package sort
// A type, typically a collection, that satisfies sort.Interface can be
// sorted by the routines in this package. The methods require that the
// elements of the collection be enumerated by an integer index.
type Interface interface {
// Len is the number of elements in the collection.
Len() int
// Less returns whether the element with index i should sort
// before the element with index j.
Less(i, j int) bool
// Swap swaps the elements with indexes i and j.
Swap(i, j int)
}
It would have implications on array indices as well, since they are also int.