Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site drux3.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!hogpc!houxe!drutx!drux3!pcf From: pcf@drux3.UUCP Newsgroups: net.lang.c Subject: Re: nested comments Message-ID: <1234@drux3.UUCP> Date: Tue, 16-Oct-84 12:55:50 EDT Article-I.D.: drux3.1234 Posted: Tue Oct 16 12:55:50 1984 Date-Received: Wed, 17-Oct-84 06:30:01 EDT References: <12904@sri-arpa.UUCP>, <35@tikal.UUCP> Organization: AT&T Information Systems Laboratories, Denver Lines: 36 > ... In another language design, there are probably better ways to > go--such as Ada's "--" which is ALWAYS terminated at end of line. > (Commenting out a section of code is easy; just prefix each line with --.) # ifdef ignore Assuming that you have at most, one comment ending per line, then isn't prefixing each line with '/*' just as easy as '--'. ( O.K. so you have to put a '*/' at the end of the block. ) # endif BCPL (parent of C) has both '/*'..'*/' block comments and '//' to end of line comments. One tends to use '/*'..'*/' for long comments and '//' for in-line mixed code and comment. Hence you can use '/*' .. '*/' to comment out a block of code that has '//' comments. In many years of using BCPL, I never had any problem with nesting comments and do not know if block comments nest. I think that '//' would be a useful, compatible, etc addition to C. /* for( ;; ) { switch(c) { case 0: break; // continue loop case 1: continue; // break out of loop } break; // continue with rest of program } */ Peter C. Fry drux3!pcf