Enforced immutability: Difference between revisions
→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)"
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
||
Line 1,282:
</syntaxhighlight>
=={{header|V (Vlang)}}==
In V (Vlang):
1) Variables are immutable, by default.
Line 1,294:
To change the values of variables, arguments, and struct fields the keyword "mut" is used.
<syntaxhighlight lang="v (vlang)">// To change the value of the variable, after making it mutable with "mut", use "=".
mut age := 20
|