The current syntax for initialization is unconvenient for complex cases.
Example
Suppose I want to initialize an attribute x to any value from -10 to 10. That's easy:
interface = x: -10..11 # Remember, ranges in LAbs are Python-style
Now suppose I want to exclude 0 from these values. Currently, the only way is to enumerate all values:
interface = x: [-10, -9, -8, ..., -1, 1, ..., 10]
Proposal
Improve the parser/codegen so that the user can provide multiple, comma-separated initializers (ranges or values). Our example would then become:
interface = x: [-10..0, 1..11]
The current syntax for initialization is unconvenient for complex cases.
Example
Suppose I want to initialize an attribute
xto any value from -10 to 10. That's easy:Now suppose I want to exclude
0from these values. Currently, the only way is to enumerate all values:Proposal
Improve the parser/codegen so that the user can provide multiple, comma-separated initializers (ranges or values). Our example would then become: