Skip to content

Add array-like category type #9

Open
@Micovec

Description

I'd love to be able to define multiple instances of a category inside an array.

Currently there's special category that can be defined multiple times to hold config data. Such as:

special {
    key = a
    value = 1
    ...
}

special {
    key = b
    value = 2
    ...
}

However, a special category is required to have a primary key which is then used to retrieve it's config values.

If I wanted to define an unlimited number of categories of the same type I'd then have to use an incremental primary key which I would need to keep track of. Especially it would be even more difficult when I would remove several definitions. A gap in primary key sequence would occur and then I'd have to look for the highest ones and lower them in order to keep them unique and continuous.

So I propose a new syntax for defining multiple instance of the same category without a primary key (similar to json):

array-like-category [
    {
        value = 1
        ...
    },
    {
        value = 2
        ...
    }
]

I tihnk that the comma separating categories isn't necessary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions