Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line Comments in Standard ML

Tags:

sml

smlnj

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?

like image 239
icco Avatar asked Jan 08 '10 18:01

icco


People also ask

Which is a line comment?

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.

What is the code for a single line comment?

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).

What is single and multi line comment?

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.

How do I insert comment in one line?

// 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.


2 Answers

You're stuck with block comments.

On the other hand, block comments can be nested: (* (* *) still comment here *)

like image 104
Victor Nicollet Avatar answered Sep 20 '22 00:09

Victor Nicollet


There is a RFC for line comments, which proposes a hashmark followed by a whitespace.

like image 43
Adam Howell Avatar answered Sep 21 '22 00:09

Adam Howell