Re:Go 2, here we come
by scott_s on Friday November 30, 2018 @11:44AM
(#18570329)
I actually agree. I was responding to someone who dismissed the entire concept.
[ Parent
| on HN ]
no, I get that, but int is not for pointer<->integer conversions. That is very specifically a separate type:
uintptr an unsigned integer large enough to store the uninterpreted bits of a pointer value
https://golang.org/ref/spec#Numeric_typesSure, but did I imply it was? Iām genuinely confused.
> language allows casting pointers to integers
The original thread was about converting int to be an arbitrary precision type: "so that 'int' can become a true integer". One would imagine that, to preserve the ability to do pointer <-> non-pointer number, they would just leave uintptr alone, and so basically ignore your concerns, whereas int as the "native type" for slice indexes and the like is a more likely reason to prevent messing with "int" itself
Okay, that's the source of the confusion. I was not replying to that sentiment, which is a nuanced discussion on what an int should be. I was replying to the_clarence's categorical dismissal of variable width integer types.