@user202729 I’m not seeing this as ‘basic’ I guess because most of the time string comparisons work, and it’s rare in my experience to need tl comparison in an expansion context
@user202729 If the strings are handled as macro-arguments, handling implicit/explicit spaces is not a big deal as only explicit space tokens cannot be grabbed as undelimited macro-arguments but leading explicit space-tokens of macro-arguments can be detected. The hard problem is finding an expandable way of, e.g., distinguishing explicit non-active character token from its active pendant when that is let equal to that non-active character token.
@user202729 Same problem with one-letter-control-sequences whose name equals the explicit character token which they are let equal to while \escapechar is negative. Handling of explicit catcode-1/2-character-tokens is cumbersome also but is feasible if you are willing to have a bumch of code only for doing brace-hacks.
@user202729 Scenario 1: \begingroup\catcode`\Z=13\def\temp{\endgroup\letZ= }\temp Z -- how to expandably distinguish active-Z from letter-Z under these conditions without using macros that process delimited arguments? (\show Z in the first case delivers > the letter Z. and in the second case delivers > Z=the letter Z., so the phrases delived by \show slightly differ. But this is not the case for \meaning and \show is not expandable.
@user202729 Scenario 2: \let\!=!\escapechar=-1 -- how to expandably distinguish \! from ! under these conditions without using macros that process delimited arguments?
@DavidCarlisle Sorry was a bit distracted -- my husband was asking about the skittles championship down under --. Lively discussion about (color/begin) groups ;-)