sml

Comments

Syntax#

  • (* opens a block comment
  • *) closes a block comment
  • (* and *) must be balanced in number

All comments are block comments

(*************************************************
*  All comments in SML are block comments
*  Block Comments begin with '(*'
*  Block Comments end with '*)'
*  (* Block Comments can be nested *)
*  The additional framing asterisks at the beginning
*  and end of this block comment are common to languages
*  of SML's vintage.
*  Likewise the asterisk at the start of each line
*  But this is solely a matter of style.
**************************************************)

val _ = print "Block comment example\n" (* line ending block comment *)

Nested Comments

(* The block comment syntax allows nested comments
(* whether or not this is a good thing is probably
a matter of personal opinion (*or coding standards*)*)*)

val _ = print "Nested comment example\n" (* line ending block comment *)

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow