简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM