You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes we want to pass an optional value, and interpolating them as-is usually does not make sense.
Example
[int||Something happened. My value is #{mValue}] - here we want "My value is ..." to appear only when mValue is set. In minimalistic cases, we want to at least add conditional space before/after the value.
Use case 2
Text colorizing.
Use case 3
Test padding.
Possible interface
We need to allow abitrary pieces of text into modifier, this can look like
[int||look at red%[this colored text]|]
And this new syntax should work when some special switch is enabled.
Handling optionals is trickier, need to think about this. It can look like
[int|Something happened. ?[My value is #{mValue}]|]
where ?[...] handles the only interpolated value inside it.
The text was updated successfully, but these errors were encountered:
Motivation
Use case 1
Sometimes we want to pass an optional value, and interpolating them as-is usually does not make sense.
Example
[int||Something happened. My value is #{mValue}]
- here we want "My value is ..." to appear only whenmValue
is set. In minimalistic cases, we want to at least add conditional space before/after the value.Use case 2
Text colorizing.
Use case 3
Test padding.
Possible interface
We need to allow abitrary pieces of text into modifier, this can look like
[int||look at red%[this colored text]|]
And this new syntax should work when some special switch is enabled.
Handling optionals is trickier, need to think about this. It can look like
[int|Something happened. ?[My value is #{mValue}]|]
where
?[...]
handles the only interpolated value inside it.The text was updated successfully, but these errors were encountered: