This seems like a very basic question and I'm sure it's been answered somewhere, but I can't find anything on it. The closest I've gotten is this question, but neither of the solutions in the accepted answer help my code.
I'm trying to branch based on the value of a namespace parameter. If I replace the \namedordefaulteraparameter{#1}{formatdecoration} with a literal yes, I get "y" as I'd expect, and just printing the value of that macro also gives me the "yes" it should. However, when I pass the macro to the test, I always get "n". I'm guessing that this is due to \doifsamestringelse testing the values without expanding them, but no matter how many \expandafters I use or where I put them, I can't get the first result to be included. What am I missing?
\definenamespace[era][
type=module,
name=era,
command=yes,
setup=yes,
]
\setupera[
formatdecoration=yes,
]
\define[2]\namedordefaulteraparameter{%
\doifsomethingelse
{\namederaparameter{#1}{#2}}
{\namederaparameter{#1}{#2}}
{\eraparameter{#2}}%
}
\def\eradecorated[#1]#2{%
\doifsamestringelse{yes}{\namedordefaulteraparameter{#1}{formatdecoration}}
{y}
{n}%
}
I know I could do this pretty easily in Lua, but for something so simple, I don't see any reason to add that extra syntax.
\define[2]\...with\defineexpandable[2]\...to create a expandable command. – Wolfgang Schuster May 21 '17 at 08:47\def...#1#2. But thanks for the suggestion. – Henri Menke May 21 '17 at 08:53\defineis touched upon on its wiki page, but the only place I saw\expdoifelseeven mentioned was in the release notes, and that doesn't include any description of what it's for. Are there some other docs I should be looking at, or do I just have to read through the mailing list or something? – WovenTales May 21 '17 at 16:19