I spent some time trying to write a helper macro to check the parameter for the new value, otherwise use the existing value - default values ββexist for all parameter positions.
I wanted to write:
\foo{left}{nil}{}{20pt}
so that the second parameter uses its current value, but the third value would be the empty string value. I wanted to use the notation:
\edef\pA{\isnil{
I defined \ isnil as follows:
\def\nil{nil} \def\isnil#1#2#3{% \edef\nilTest{#1}% \ifx\nilTest\nil#2\else#3\fi }
but when I tried to run it, TeX complained that \ nilTest was an undefined escape sequence. Of course, this is true, but I want \ pA to save the value, not the recipe for the value, so it should be \ edef, which means that all macro tests will be expanded, but so far \ edef will not protect \ nilTest - this is the place to use \ noexpand - this doesn't seem to work for me.
EDIT: There are no digits in the names of \ cs (yes, I knew that.)
source share