I thought I had understood at least some aspects of macros, but it turns out I'm as lost as always. Here's my problem: I'm writing a module which will have a \setupcommand. The value is given in a [key=pair] list, so I thought I could use \getvariable. What I have is \def\setupcommand{\setvariables[namespace]} % setting up the namespace \setvariables[namespace][key=value,otherkey=value] % initializing the keys % And now I want to wrap my values up in a conditional statement: \doifelse{\getvariable{namespace}{key}}{value} {do something} {do something else} When I put the \doifelse statement into my source files, the test works; the key is assigned the value that is in the setupcommand. But this doesn't work at runtime: either \getvariable{namespace}{key} always has the value I assign in the line \setvariables[namespace] [key=value,otherkey=value], or if I comment out that line, the variable is empty. I can see why this is the case: the setupcommand is read AFTER the module, so at runtime, the variable is not assigned yet. So my approach seems fundamentally flawed. What could I do instead? Thanks for your help Thomas