Is it safe to define \@nil?

I've been having a random issue recently with dblfnote, where TeX tells me that it's trying to execute \@nil, which is undefined.

Now, I did my research and saw from source2e that \@nil is generally used as a delimiter in list macros. That's exactly what dblfnote uses it for.

Is there any reason that I can't define \@nil as a totally blank token? Something like

\makeatletter\def\@nil{}\makeatother


It's never supposed to be executed, so is there harm in defining it? At least as a temporary fix?

• I would not define it either. Also, it does not solve the problem that there is code that wants to execute \@nil. The faulty code should be fixed instead. Can you generate a minimal working example (MWE)? Sep 6 '17 at 16:39

Most uses of \@nil just use \@nil as a macro argument delimiter so it doesn't matter what the definition is, however this is intentionally undefined. If you have code that is trying to execute \@nil then there is an error earlier and code that should never be evaluated is being evaluated. Defining it to something will just be masking a problem elsewhere.
• @AGoldMan it's safe to do all kinds of things while debugging, one common technique is to repeatedly delete half the code to narrow down to the code that's generating an error. This might be considered similar: if (somehow) it helps you find the problem then sure that's fine, but once the problem is found discard all such changes that were made for debugging. I wouldn't distribute a package that defined \@nil any more than I'd distribute a package with half its code deleted while tracking down a bug. Sep 9 '17 at 17:53