This one bit me today

Austin Ziegler austin at bucsf.bu.edu
Wed Oct 25 01:54:47 AEST 1989


>>>>> On 24 Oct 89 09:20:32 GMT, ok at cs.mu.oz.au (Richard O'Keefe) said:

RO> In article <41019 at bu-cs.BU.EDU>, austin at bucsf.bu.edu (Austin Ziegler) writes:
>    I read the rest of your article, but this is the one part I have
> problems with.  I am originally a Pascal programmer, and have been
> programming in C for enough time to acquaint myself with the language.  In
> Pascal, one of the nicest features for debugging is nested comments.

RO> Er, there's something your best friend should have told you: Pascal
RO> comments DO NOT NEST.  Neither in the ANSI standard, nor the ISO
RO> standard, nor Jensen & Wirth, nor either of the Pascal compilers I just
RO> checked (although one of them prints a warning if it sees '(*' inside
RO> '(*').

     Every pascal compiler I have seen accepts both '{' and '(*' as
characters which start comments.  That means you could have a { (* *) }
comment or a (* { } *) comment.  Beyond that, Pascal DOES NOT NEST.  Even
though they are two different sets of characters, they both delimit
comments.  Another point in case for multiple forms is '[]' and '(..)'.
Followups directed to comp.lang.pascal before this gets too far out of the
range of C.

	  Elminster, the Sage of Shadowdale (austin at bucsf.bu.edu)
	       700 Commonwealth Box 2094, Boston, MA  02215
				     
	       (* This is a { nested } comment in Pascal. *)



More information about the Comp.lang.c mailing list