You can have both mutability and immutability in the same language. Example from Ruby:
$ irb
2.4.1 :001 > a = [1, 2, 3]
=> [1, 2, 3]
2.4.1 :002 > a.map {|x| x + 1}
=> [2, 3, 4]
2.4.1 :003 > a
=> [1, 2, 3]
2.4.1 :004 > a.map! {|x| x + 1}
=> [2, 3, 4]
2.4.1 :005 > a
=> [2, 3, 4]
2.4.1 :006 > a.freeze # make a immutable
=> [2, 3, 4]
2.4.1 :007 > a.map! {|x| x + 1}
RuntimeError: can't modify frozen Array
Ruby is fundamentally a language based on mutability, but it shows that it should be possible to have both ways. Questions:
1) Is really there a language which is fully agnostic about mutability and immutability?
2) If not, it's maybe because designers have strong opinions about this matter? Actually IMHO designing a fully agnostic language would demonstrate strong opinions too.
1) Is really there a language which is fully agnostic about mutability and immutability?
2) If not, it's maybe because designers have strong opinions about this matter? Actually IMHO designing a fully agnostic language would demonstrate strong opinions too.