Skip to content

Add operator support #14

@brettlangdon

Description

@brettlangdon

Idea revitalized from #9

Originally I wanted to support operators like +, -, / and *, but cut it out of the original scope and now am considering adding them back in.

The simple use case here is for numbers.

primary {
  num_workers = 2;
}
secondary {
  num_workers = 4;
}

total_workers: primary.num_workers + secondary.num_workers;
one_hour = 3600;

primary {
  interval = 5 * one_hour;
}

As well, concatenation for strings would be helpful:

prefix = "prefix";

primary {
    string_setting = prefix + "primary";
}

secondary {
  string_setting = prefix + "secondary";
}

Where is starts to get trickier is with sections, do we merge them together?

primary {
  some_setting: "value";
}

secondary {
  some_setting: "another value";
}

all_settings: primary + secondary;

What is the value of all_settings here?

Also, should consider this for lists when they are supported. Lists will probably be treated as sets and also support unions, intersections and etc

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions