umka-lang
umka-lang copied to clipboard
Structured constants are not constants
type S = struct {
x, y, z: int
}
const (
a = [2]int{2, 7}
b = []real{3.14, 6.28}
c = S{7, 8, -3}
)
fn main() {
a[1] = 6
b[0] = -0.666
append(b, 17.2)
c.x *= 2
printf("%v %v %v\n", a, b, c) // [2 6] [-0.666 6.28 17.2] {x: 14 y: 8 z: -3}
}