Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Comments (Reprise)

Part of TutorialIntermediate

Description

More comments is better than fewer comments.

Example

module comments;

/* This purpose of this code is to 
   show how documentation can be done with comments. */


/*/   */


// single line


import std.string;


/*

Mult-line

*/

int usefulInteger;

/+ 

simple nested

+/

string someString;

/+ 
/+/ +/
level 1 nested

    /+
    
    level 2 nested
    
        /+
        level 3 nested
        +/
    
    +/

+/


/* The actual program (anti-climatic) */

int main()
{
    string someOtherString = someString;

    int anotherInt = usefulInteger;

    return 0;
}

Source

Link http://www.dsource.org/tutorials/index.php?show_example=85
Posted by jcc7
Date/Time Fri May 14, 2004 10:45 pm