Zig NEWS

Discussion on: Re: Makin' wavs with Zig

 
xq profile image
Felix "xq" Queißner

Just to clarify my thinking: Imho constants should be untyped as their implicit type is actually a integer that only allows a single value (which is the value of the constant) and thus can be stored in 0 bits. I guess when Zig gets the @Int(min,max) type, a constant x will just be of the type @Int(x,x), which can be stored in 0 bits, but has a value that can exceed any reasonably storable number. This allows assigning a constant x=7 to both a @Int(0,7) as well as to a @Int(7,14)