[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing comment styles and strings

This page is part of the web mail archives of SRFI 30 from before July 7th, 2015. The new archives for SRFI 30 contain all messages, not just those from before July 7th, 2015.

>>>>> "John" == jtobey  <jtobey@xxxxxxxxxxxxxxxxxxxx> writes:

John> Is this supposed to be a comment or only the beginning of one?
John>     #| ; |#

John> The lexical production rules say this "|#" is ignored as part of a
John> nested single-line comment, but the implementation regards it as the
John> end of a multi-line comment.

The semicolon does not start a single-line comment because it matches
<comment text>.

John>     #|
John>      "This string |# is unbalanced."
John>     |#

John> My intuition tells me the quoted "|#" does not terminate the comment,
John> but the SRFI and implementation say that it does.  Should it be
John> possible to comment out strings and single-line comments that contain
John> the comment delimiters?

Recognizing strings within comments has a rather non-intuitive
consequences: you could write double quotation marks within a comment
pairwise only.