Jump to content

Enforced immutability: Difference between revisions

→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)"
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
451

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.