From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <2ce618c636a8a74af13258cdeaa93de0@plan9.jp> To: 9fans@cse.psu.edu Subject: Re: [9fans] Include guards and multiple includes From: Joel Salomon Date: Mon, 23 Oct 2006 15:12:17 -0400 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: d33187e4-ead1-11e9-9d60-3106f5b1d025 > > ?c only recognize 9 > > preprocessor symbols: >=20 > and that's easily more than too much When metaprogramming techniques are needed, should we have the C preprocessor or are we going to get a better tool? (I know! I know! C++ templates! =E2=98=BA) I=E2=80=99ve needed the full-power preprocessor in the past, when I had t= o implement a miniature function-generating and function pointer table populating mini-language (and it really was the most readable, debuggable, and maintainable implementation of the spec possible). I didn=E2=80=99t need the various #ifs, but I did need ANSI-type macro expansion; IIRC, ?c=E2=80=99s is different enough=E2=80=94and not so well= documented (looking at the implementation of the assert macro; how do you do symbol catenation, or conversion to a string?)=E2=80=94that an implementa= tion of this trick would need subtle rewriting. I don=E2=80=99t know if a =E2=80=9Cgood=E2=80=9D metaprogramming/code gen= eration tool is possible for a language with syntax more complicated than Lisp=E2=80=99s,= but even CPP has its use. For the sort of conditional compilation admitted by =E2=80=9C#ifdef Consi= dered Harmful=E2=80=9D, what minimal set of CPP symbols would suffice? --Joel