Talk:Comments

Revision as of 20:18, 29 September 2007 by Ce (talk | contribs) (Forgot signing, and now found another interesting quote from the standard)

Pascal Comments

The Pascal section claims that '{' and '}' are Turbo Pascal extensions. However the Pascal Standard, ISO/IEC 7185:1990 explicitly contains:

6.1.8 Token separators
Where a commentary shall be any sequence of characters and separations of lines, containing neither
} nor *), the construct
( `{' | `(*' ) commentary ( `*)' | `}' )
shall be a comment if neither the { nor the (* occurs within a character-string or within a commentary.
NOTES
1 A comment may thus commence with { and end with *), or commence with (* and end with }.
2 The sequence (*) cannot occur in a commentary even though the sequence {) can.

Therefore { and } are comment delimiters in standard pascal. Note that comments like

(* this }

or

{ this *)

are valid Standard Pascal comments, but not valid Turbo Pascal comments.

Another interesting quote from the standard:

6.1.9 Lexical Alternatives
[...]
The comment-delimiting characters { and } shall be the reference representations, and (* and *)
respectively shall be alternative representations (see 6 .1 .8).

I guess it couldn't be more explicit :-) --Ce

Return to "Comments" page.