Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Comments

Comments in Solstice can be done in 3 ways:

// (Single-Line Comment)

Use // to tell Solstice to ignore text until the end of the line.

This kind of comment should be used inside code to explain how parts of code work.

/* */ (Multiline Comment)

Use /* and */ to tell Solstice to ignore text in between the two markers.

This kind of comment should be used for explainations of how functions and structs work, placed above the definition.

# (Shebang Comment)

Use # to tell Solstice to ignore text until the end of the line.

This kind of comment should be used in a shebang (writing #!/usr/bin/env solstice at the top of your entry point source file), not in the middle.

Example

#!/usr/bin/env solstice

/*
    This function does something.
    Input:
        funnyNumber: A funny number
    Returns: Another funny number
*/
def doSomething(int funnyNumber) int {
    // Tell the user the number is funny
    puts "The number" funnyNumber "is very funny"

    // Now give them another funny number
    return 532
}