Comments are text in your code that are ignored by the interpreter. Use them to document what your code does.
Single-line comments start with // and continue to the end of the line:
// This is a comment
x = 5
// You can have multiple comment lines
// This is clear documentation
function process(data)
return data * 2
end
// Inline comments work too
y = x + 10 // Add ten to x
Multi-line comments use /* ... */ syntax and span multiple lines:
/* This is a block comment
that spans multiple lines
and is useful for longer explanations */
/*
You can format them nicely:
- First point
- Second point
- Third point
*/
print("Hello")
Multi-line comments support nesting, which is useful for commenting out code blocks that already contain comments:
function helper()
// This function does something useful
return 42
end
/*
Commenting out a block of code:
result = helper()
// Process the result
print(result)
*/
Without nesting support, the inner // comment would break the outer block comment. Duso handles this gracefully.
// for quick notes and inline comments/* ... */ for longer explanations and documentation blocks