Variables: Difference between revisions
→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)"
No edit summary |
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
||
Line 5,298:
Attributes <code>Public</code> or <code>Private</code> can mofidy these scopes.
=={{header|V (Vlang)}}==
<syntaxhighlight lang="
age := 20
large_number := i64(9999999999)</syntaxhighlight>
Line 5,311:
'''Mutable variables'''
<syntaxhighlight lang="
println(age) // 20
age = 21
Line 5,328:
'''Declaration errors'''
In development mode the compiler will warn you that you haven't used the variable (you'll get an "unused variable" warning). In production mode (enabled by passing the -prod flag to v – v -prod foo.v) it will not compile at all (like in Go).
<syntaxhighlight lang="
a := 10
if true {
|