Open lou1306 opened 5 years ago
The current syntax for initialization is unconvenient for complex cases.
Suppose I want to initialize an attribute x to any value from -10 to 10. That's easy:
x
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:
0
interface = x: [-10, -9, -8, ..., -1, 1, ..., 10]
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
x
to any value from -10 to 10. That's easy:Now suppose I want to exclude
0
from 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: