I suppose you could explain it that way.
But given that it's not an object oriented language, how could any variable be mutable given your example/definition?
How could you mutate a variable in a way that this language disallows?
But given that it's not an object oriented language, how could any variable be mutable given your example/definition?
How could you mutate a variable in a way that this language disallows?
I presume something like this:
array a = [1, 2, 3]
a.append(4)
Names are mutable, but the values they point to are not. a[0] = 1
Would be a better example. Appending to an array could involve creating a new array and reassigning it to ‘a’.> Arrays and the elements of arrays are also immutable
I guess the docs need a bit of rewording. Forcing a deep-copy on variable assignment does not mean the variable itself is immutable.
> Chaos language is not object-oriented. So everything is done by functions and data types.
https://www.amazon.com/Purely-Functional-Structures-Chris-Ok...