Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!brl-sem!brl-smoke!smoke!see@NTA-VAX.ARPA From: see@NTA-VAX.ARPA (Stein-Erik Engbr}ten) Newsgroups: net.lang.c Subject: define kinda stuff Message-ID: <2604@brl-smoke.ARPA> Date: Mon, 14-Apr-86 05:29:51 EST Article-I.D.: brl-smok.2604 Posted: Mon Apr 14 05:29:51 1986 Date-Received: Fri, 18-Apr-86 03:55:18 EST Sender: news@brl-smoke.ARPA Lines: 35 David Eppstein (eppstein@cs.columbia.edu, seismo!columbia!cs!eppstein) writes (11 Apr 86 21:12:26 GMT) The problem is to define '(-:' as '/*' (start of comment), and :-) '*/'. > Obviously the right way to do this is the following: > > #define cat(a,b) a/**/b > #define (-: cat(/,*) > #define :-) cat(*,/) The preprocessor doesn't allow '(-:' as a definition-name (Berkeley 4.2/4.3). However, the program below doesn't do what it is supposed to either. When the preprocessor has finished, you just get 'main() {'. -->#define cat(a,b) a/**/b -->#define start_comm cat(/,*) -->#define end_comm cat(*,/) --> -->main() -->{ --> start_comm This is a comment end_comm --> cat(pri,ntf)("This is a nice one...\n"); --> printf("Hello...\n"); -->} When in a comment, no expansion is done! How do we then define something which is to end a comment? I would say it is impossible, but is eager to hear of anybody who thinks otherwise. Stein-Erik Engbr}ten