by nitrogen · 14y ago · 0 comments
Example based on the syntax from the article:
x: int<+32>;
x[0:6] = 42; // Set six bits starting with lsb 0 to 42In fact, it doesn't reach top priority since we can do without for now (we have bitfields.) The issue with slicing is more a question of design: does slicing need to be constant expression or should we authorize more expression power (and then how could we implement that and how could we check it … )
Anyway, I'm looking for a clever way to define values accessed in a none uniform ways.
Integer as bit array was the simplest idea to test (and seems useful to me.) Now the compiler has almost everything I need to implement easily that kind of syntactic sugars.