Skip to content

Literals in Specification#102

Merged
mtinning merged 10 commits intomasterfrom
literal
Dec 12, 2019
Merged

Literals in Specification#102
mtinning merged 10 commits intomasterfrom
literal

Conversation

@phil-brad
Copy link
Member

Branched off #101 so merge that first.

Implements literals in the spec with a ~ prefix so that for example with "~alpha": ["egg", "tadpole", "frog"] the parameter value will be passed through as a list rather than being expanded into multiple leaves. The parameter name is converted to alpha i.e. loses the prefix. Also works with values that are dicts and that appear as macros, generators, evaluators or equations e.g. "~alpha": "$NotAMacro" will pass through "$NotAMacro" as parameter value.

Literals can also be specified value-side as a string such as:

  • "alpha": "~[1, 2, 3]"
  • "alpha": "~$NotAMacro"

If a literal is specified on both the key and value, then the value is taken as literal (allowing a parameter value to start with ~) such that "~alpha": "~I like tildes" evaluates to a parameter of name alpha with value "~I like tildes".

@phil-brad phil-brad requested a review from mtinning October 31, 2019 15:40
@mtinning mtinning merged commit b6f2012 into master Dec 12, 2019
@phil-brad phil-brad deleted the literal branch December 17, 2019 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants