Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!drutx!mtuxo!houxm!whuxl!whuxlm!akgua!gatech!seismo!brl-adm!brl-smoke!smoke!see@NTA-VAX.ARPA From: see@NTA-VAX.ARPA Newsgroups: net.lang.c Subject: define kinda stuff Message-ID: <2602@brl-smoke.ARPA> Date: Mon, 14-Apr-86 03:02:33 EST Article-I.D.: brl-smok.2602 Posted: Mon Apr 14 03:02:33 1986 Date-Received: Sun, 20-Apr-86 18:09:05 EST Sender: news@brl-smoke.ARPA Lines: 27 David Eppstein (eppstein@cs.columbia.edu, seismo!columbia!cs!eppstein) writes (11 Apr 86 21:12:26 GMT) > Obviously the right way to do this is the following: > > #define cat(a,b) a/**/b > #define (-: cat(/,*) > #define :-) cat(*,/) The problem is to define '(-:' as '/*' (start of comment), and :-) '*/'. Please correct me, but I feel this will not work. Either the cat-definition will look like 'ab' when it is expanded - obviously wrong -, or it will look like 'a/**/b', which is wrong also. If you get '//**/*' as the expansion, this surely isn't a start of a comment. The whole thing boils down to whether the preprocessor does recursive deletion of comments, which it never has as far as I know. For example: /* if (variable != 21) { /* Test for ... */ has always been a comment-line, where the first '/*' is an easy way to discard the whole line. If you put another '*/' at the end of the line, the 'syntax error' is very near...