pdfTeX added some new primitives, based on e-TeX, including \ifincsname. When this primitive is being expanded between a pair of \csname ... \endcsname, the result of expansion will be true, otherwise false will be the result.
As the successor of pdfTeX, LuaTeX conserves \ifincsname as its primitive; in terms of XeTeX, it implements the \ifincsname primitive, too. However, in (e-)upTeX (and also ApTeX), there is not a primitive named or equalling to pdfTeX's \ifincsname.
Hence, here is the question: how to implement a macro to define if a macro is being expanded between \csname ...\endcsname, in (e-)upTeX.
\ifincsnameis a tricky thing at best - nesting can be a real issue. – Joseph Wright Dec 05 '17 at 09:43: (– Ch'en Meng Dec 05 '17 at 09:46pdfTeXis frozen and future development is focused onLuaTeX. – Ch'en Meng Dec 13 '17 at 02:54