Re:Hacking Elixir's Syntax
by rvirding on Wednesday June 17, 2015 @06:23PM
(#9735671)
Why not just write it in hexadecimal?
[ Parent
| on HN ]
Sometimes you are dealing with fields that are packed into a 32-bit (or 8- or 16- or 64-bit) word where one field is bits 0 through 5 and another field is bits 6 through 9 and a status bit in bit 10 and another field is bits 11 through 31. Thinking about those in hex is much harder than if they were all nice multiples of 4 bits in size. Yes, C programmers have been dealing with this for decades (no binary literals in C), but wouldn't it be nice to write each of those fields in binary (with underscores separating them) and let the machine do the rest?