Sujet : Re: Block Comments Or Rest-Of-Line Comments?
De : cross (at) *nospam* spitfire.i.gajendra.net (Dan Cross)
Groupes : comp.lang.cDate : 21. Mar 2024, 18:58:49
Autres entêtes
Organisation : PANIX Public Access Internet and UNIX, NYC
Message-ID : <uthsgp$94j$1@reader1.panix.com>
References : 1 2 3
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
86r0g3liii.fsf@linuxsc.com>,
Tim Rentsch <
tr.17687@z991.linuxsc.com> wrote:
scott@slp53.sl.home (Scott Lurndal) writes:
>
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
The original comment delimiters in C were copied from PL/I: everything
>
Cite?
>
Seen in the B language manual:
>
Comments are delimited as in PL/I by /* and */.
>
https://www.bell-labs.com/usr/dmr/www/kbman.html
>
Note that this style of commenting was not present in
B's precursor language, BCPL.
It would be appropriate to qualify this statement with some kind
of timeframe as BCPL is still used (albeit not widely, I
assume).
The current version of the language includes `/* ... */` comments
as one of two supported forms:
https://www.cl.cam.ac.uk/~mr10/bcplman.pdfIt appears that this was also present in the 1979 version
described in, "BCPL the language and its compiler" by Martin
Richards:
https://ia803107.us.archive.org/16/items/richards1979bcpl/richards1979bcpl.pdf;see in particular the lexical analyzer fragment starting on line
127 of page 87.
However, I believe this was not the case at the time that B was
defined. At least, it is not in the BCPL definition just a
couple of years earlier, despite several years of experience
with PL/1 by then:
https://www.bell-labs.com/usr/dmr/www/bcpl.pdfIndeed, Dennis Ritchie suggested that some changes to BCPL were
influences taken from C:
https://www.bell-labs.com/usr/dmr/www/bcpl.htmlCertainly, both Multics and CTSS BCPL only understand `// ...`,
and those are likely the compilers that Ken Thompson would have
been most familiar with at the time B was created. E.g.:
https://github.com/dancrossnyc/multics/blob/main/library_dir_dir/system_library_tools/source/bound_bcpl_.s.archive/bcpl_lex1.bcpl#L90Regarding the original claim, despite OP being a known troll, it
appears to be true. Dennis Ritchie also mentioned it in his C
history paper:
https://www.bell-labs.com/usr/dmr/www/chist.htmlAs far as I know, PL/I was the first language to use `/*` and
`*/` as comment delimeters.
- Dan C.