Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: #if inside #define -- easy to do, but is it a good idea? Message-ID: <6519@brl-smoke.ARPA> Date: Mon, 5-Oct-87 18:13:33 EDT Article-I.D.: brl-smok.6519 Posted: Mon Oct 5 18:13:33 1987 Date-Received: Thu, 8-Oct-87 05:42:12 EDT References: <157@decvax.UUCP> <29339@sun.uucp> <10898@orchid.waterloo.edu> <7510@elsie.UUCP> <163@decvax.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 20 In article <163@decvax.UUCP> minow@decvax.UUCP (Martin Minow) writes: -(2) Note that C doesn't give the programmer the tools to generate - flexible counters. I.e, CPP is not a general purpose macro - processor. Of course, K&R said this first. -It should be pointed out that if you use command files, makefiles or -their equivalent, it is very easy to build special purpose table -generators that are automatically invoked when the appropriate module -is compiled. The realworld (say, constructing menus for a window -system) requires more complex table constructions than my simple -extension would allow. Yacc and lex users have known this for years. I believe this is essentially the position X3J11 has taken in response to requests for more generic preprocessing capabilities (other than # and ##, for which the need had been convincingly demonstrated by the non-portable kludges that programmers had widely resorted to). The idea is to fix up the specification that was already there, not dream up new, powerful facilities when viable alternatives exist. In particular, the C preprocessor cannot be conveniently turned into a general macro processor without invalidating lots of existing correct code. But don't quote me..