For example, this is very useful when declaring constant sizes in megabytes and kilobytes:
$ cat foo.wuffs
packageid "xxxx"
pri const maxSize u32 = 1 << 10 // 1KiB
$ wuffs-c gen -package_name xxxx foo.wuffs
invalid const value "1 << 10"
Would be neat if the compiler performed the calculation, similar to what the Go compiler does. For now, I'm just writing out the full numbers directly.
For example, this is very useful when declaring constant sizes in megabytes and kilobytes:
Would be neat if the compiler performed the calculation, similar to what the Go compiler does. For now, I'm just writing out the full numbers directly.