A little m4 puzzle
Doug McIlroy <[email protected]> Sat, 10 Nov 2018 13:01:40 -0500
| Newsgroups | gmane.comp.gnu.m4.general |
|---|---|
| Message-ID | <[email protected]> |
Consider this predicate on strings. define(eq,`define(`_$1',F)define(`_2',T)_$1') eq(x,y) yields T or F according as strings x and y are the same or different. (The strings may contain only characters allowed in macro names). The puzzle: If you omit inner quotes from the definition, eq(A,A) yields T as intended. But what happens when you repeat the test? (Incidentally, you can replace T by `$3' and F by `$4' to make a near replacement for the builtin ifelse.)