//Here's a line comment, and below you see few more: main fixed f = math.pi // f == Pi i.e. 3.12... print f.round down // f == 3
Comments are used to embed human readable notes and documentation in the source code. Good programming style is to explain by a comment each function, class and method in the program. Comments are useful also to clarify otherwise difficult code blocks, and they are needed to temporarily remove a part of the program from being compiled.
Comment is started by a special character sequence. Origo supports two types of comments: Line comments starting with two forward slashes (//), and block comments, which are written between /* and */.
Line comments are familiar to C++ programmers. Its starting sequence // comments out the rest of the line.
//Here's a line comment, and below you see few more: main fixed f = math.pi // f == Pi i.e. 3.12... print f.round down // f == 3
Block comments span multiple lines from /* up to */. They can be nested, that is, contain block comments itself.
/* Let's comment out the whole program...
main
fixed f = math.pi /* f == Pi i.e. 3.12... */
print f.round down // f == 3
*/