Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When/why did Lisps start using semicolons for comments?

What is the history of the semicolon being used for comments in Lisp and its dialects?

A guy in our group thought Clojure's use of the semicolon was an in-your-face to Java & Co. at first.

I mentioned that Lisp was older than C, but I realized that:

  • C wasn't the first language to use the semicolon as statement separator (what was? Algol?)
  • I don't know when Lisps began using semicolons for comments
  • and I don't know why Lisps began using semicolons for comments
like image 605
Matt Fenwick Avatar asked Oct 20 '11 15:10

Matt Fenwick


2 Answers

Semicolons look to be statement sequencers (rather than terminators) in Algol68.

LISP 1.5 was punch card based, so comments probably would've been written on the cards themselves, I think? The manual gives no indication that there was a mechanism for in-language comments.

The Stanford Lisp 1.6 manual shows semicolon comments.

As for the origins, I'd look to see what if anything early assemblers used for indicating comments. Certainly the semicolon is common enough in current ones.

like image 127
Jay Kominek Avatar answered Nov 03 '22 13:11

Jay Kominek


Maclisp from 1974 had semicolon as comments.

http://www.softwarepreservation.org/projects/LISP/MIT/Moon-MACLISP_Reference_Manual-Apr_08_1974.pdf

like image 39
Rainer Joswig Avatar answered Nov 03 '22 13:11

Rainer Joswig