I'm learning ML, with the SML/NJ dialect. What I'm trying to figure out is if there is a line comment operator. I found the block comment operator, (* ... *), but I really miss line comments.
Suggestions? Or am I just stuck with block comments?
Line comments generally use an arbitrary delimiter or sequence of tokens to indicate the beginning of a comment, and a newline character to indicate the end of a comment. In this example, all the text from the ASCII characters // to the end of the line is ignored.
Single-line comments start with two forward slashes ( // ). Any text between // and the end of the line is ignored by the compiler (will not be executed).
Single-line comments begin with a double hyphen ( - - ) anywhere on a line and extend to the end of the line. Multi-line comments begin with a slash-asterisk ( /* ), end with an asterisk-slash ( */ ), and can span multiple lines.
// Single-line commentsThe comment begins with a double slash (//) and ends at a newline character (\n), a carriage return (\r), or the end of the file.
You're stuck with block comments.
On the other hand, block comments can be nested: (* (* *) still comment here *)
There is a RFC for line comments, which proposes a hashmark followed by a whitespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With