Skip to content

Multiple initializations for variables #19

Description

@lou1306

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]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions