On 7/23/2017 8:46 AM, Henri Menke wrote:
On 07/23/2017 05:55 PM, Jaroslav Hajtmar wrote:
Thanx Hans for reply.
also, it depends on what you want to achieve ... maybe comparing macros is not needed at all
You have right, that anytime compares are not needed, but for my very needed compares is not working in next eight examples. Problem is in expansions macros with optional argument. For “normal” macros are compares without problem as you see in last four examples….
Did you read my first reply? Scanning for optional arguments is _inherently_ unexpandable. Peeking ahead _always_ involves \futurelet which performs an assignment. This can _never_ be edef-expanded. indeed. fwiw, one can do some trickery with lua (read and push back) but even then you run into the fact that when reading a token expansion happens (so the expanded stuff is then in front)
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------