Allow <forceUppercase/> as shortcut for <forceUppercase>true</forceUppercase> ?
-
Would it be okay to have "tagging" boolean XML-elements in themes ?
Currently it is needed to have a 1, t[rue], y[es] to enable a boolean switch in the themes:
e.g.
<forceUppercase>1</forceUppercase>
which is a redundant syntax in context of an boolean switch.My suggestion woudl be to allow also
<forceUppercase/>
to be evaluated to true.
If such an boolean element is not present it will evalated to its default nevertheless.This line can be added with an
first == '\x00' ||
to allow tagging boolean XML elements.Will this change create regressions upstream?
-
@lolonois I'm not disagreeing. I'm just trying to understand your intent. Is your argument that: three states (1, T, Y) returning affirmative is redundant, therefore we should have four (1, T, Y, existence)? I'm not trying to be argumentative; I'm just trying to understand.
-
@lolonois said in Allow <forceUppercase/> as shortcut for <forceUppercase>true</forceUppercase> ?:
e.g. <forceUppercase>1</forceUppercase> which is a redundant syntax in context of an boolean switch.
It's not redundant if you view it as a question/option value rather than an affirmation (forceUppercase?: 1/0, true/false). IMHO should be left as is.
-
Thanks both.
This XML element is not mandatory, so it can be left out and it will evaluated to false if a theme checks this value. If it is there it has to be explicitly set 1 (or semantically equivalent) to be effective. This is why I perceive it as redundant and picked the term.
Never mind, let's keep the implementation as-is.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.