The command for doing syntactical exact-match substitutions is subs, however, subs applies transformation rules throughout an expression only once. The documentation of eval claims that the (recursive) evaluation is repeated until either the result does not change, the documentation of applyrule claims that applyrule … applies the rules until no rule can be applied any more, and the documentation of MmaTranslator[Mma][ReplaceRepeated] claims that the single ReplaceRepeated command performs replacements until expression no longer changes.
So, if I comprehend correctly,
x := [[[]]]: # Remove empty lists from x repeatedly.
(*⒈*) eval['recurse'](x, [ = 'NULL']);
(*⒉*) applyrule([ = 'NULL'], x);
(*⒊*) MmaTranslator:-Mma:-ReplaceRepeated(x, [ = NULL])
should all return
NULL, but in fact,
eval['recurse'](x, [ = 'NULL']);
applyrule([ = 'NULL'], x);
Error, (in PatternMatching:-AlgStruct:-TableLookup) invalid input: unknown uses a 1st argument, x, which is missing
MmaTranslator:-Mma:-ReplaceRepeated(x, [ = NULL]);
() = ()
In other words, none of these replacements is feasible.
Have I missed something? (It seems to me that an explicit procedural
do...until loop can be actually avoidable here!)