Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!sun-barr!apple!agate!shelby!rutgers!bellcore!att!cbnewsl!dfp From: dfp@cbnewsl.ATT.COM (david.f.prosser) Newsgroups: comp.lang.c Subject: Re: Recursive Definitions: Trouble or Bad news? Message-ID: <2246@cbnewsl.ATT.COM> Date: 12 Oct 89 19:37:36 GMT References: <7657@cdis-1.uucp> Reply-To: dfp@cbnewsl.ATT.COM (david.f.prosser) Organization: AT&T Bell Laboratories Lines: 20 In article <7657@cdis-1.uucp> tanner@cdis-1.uucp (Dr. T. Andrews) writes: >I should be interested to know the latest ANSI wisdom on a construct >requesting that token BLUNGE be replaced by itself: > #define BLUNGE BLUNGE When BLUNGE is replaced, the attempted recursion is detected and the macro is left unchanged. A more complicated example would be #define A B #define B A A in which A is replaced by B and during the rescan B is replaced by A. The next rescan detects the recursion, and this A is unreplaced and is the result. Yes, this implies that the macro replacement algorithm must keep track of potentially lots of information. Dave Prosser ...not an official X3J11 answer...