On Mon, Mar 18, 2024 at 4:41 AM Daniel Lepage <dplep...@gmail.com> wrote:

> This change would be entirely backward-compatible ...

Let's consider, for example, the type uint8, aka byte. A variable of
type byte is specified* to occupy 8 bits of memory and has 256
possible values. To represent all those values and the new possibility
of the value being nil, we need 257 distinct values. But that does not
fit 8 in bits anymore. However, changing the size and/or the bit
representation of such a variable is observable, making it not
backwards-compatible.

----
*: From https://go.dev/ref/spec#Numeric_types:

""""
The value of an n-bit integer is n bits wide and represented using
two's complement arithmetic.
""""

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-XCMSmhEDGL04NfhOVpexG3GCDA0Vj2dq138pWJVSBnwA%40mail.gmail.com.

Reply via email to