Open jmcook1186 opened 4 weeks ago
@jmcook1186, should the inline arithmetic feature work only for multiplication, or should it also allow division, addition, and subtraction? For example, if we have coefficient: 3*arbitrary-constant
, it will be hard to distinguish which part is the parameter's name and which part is the math operation (I mean this part: arbitrary-constant).
oh that's a good point.
Maybe we can include a keyword and require names to be wrapped in ' '
in order for inline arithmetic to work e.g.
e.g. the =
operator is used to tell IF to evaluate the following phrase:
coefficient: = 3 * 'arbitrary-constant'
Wyt? Do you have any alternative suggestions?
@manushak
yeah, that's a good idea, but in the case of duration: 60*60*24*7*4
I don't think it will look like natural. Anyway, I don't have any suggestions right now, so I'll add =
@jmcook1186 please add the feature request in relation to this issue as part of the description
need a release in if-core before creating a PR, @narekhovhannisyan please help with that 🙏
What
Where a number is passed in a manifest, a sum should also work, e.g.
The following should be allowed:
and also the following, using other parameters in the manifest:
Why
This reduces the number of plugins required in pipelines because simple conversions that would otherwise need dedicated instances of our generic builtins can be done inline.
Context
Part of UX improvements
Prerequisites/resources n/a
SoW (scope of work)
Acceptance criteria
Given (Setup): Inline arithmetic is enabled for manifests
When (Action): I run the following manifest
Then (Assertion): I get the following output: