Re:Is your programming language unreasonable? (2015)
by masklinn on Saturday October 10, 2020 @10:12AM
(#24739124)
> Interpreting the same region as a buffer of 64-bit ints vs 16-bit uints
The variable doesn't change its type though, instead you change your interpretation of it. That's a very different and explicit operation & manipulation.
Although example 1 doesn't strictly have anything to do with types, you could get the same behaviour with `x = 0` in any language with closures (like javascript), or `foo = 0` in a language which passes parameters by (mutable) references as long as that information is not visible in the caller.
The variable doesn't change its type though, instead you change your interpretation of it. That's a very different and explicit operation & manipulation.
Although example 1 doesn't strictly have anything to do with types, you could get the same behaviour with `x = 0` in any language with closures (like javascript), or `foo = 0` in a language which passes parameters by (mutable) references as long as that information is not visible in the caller.