Hello. Why does Ruby have non-constant strings? It seems there is a way\nto bypass object encapsulation paradigm and break object integrity. Here\nis any example:\n\nclass SecureRunner\n# This class implements a sudo-like\n# runner\n\ndef initialize(command)\n# Creates an instance. Guaranties, that a command is safe.\nif command.safe?\n@comamnd = command\nelse\nraise RuntimeError, "Security check failed!"\nend\nend\n\ndef run\n# Only safe commands should be run\nsystem(@command)\nend\nend\n\n# This class seems to be safe\n# Here is a way to bypass security check:\n\ncommand = "some_safe_command"\nrunner = SecureRunner.new(command)\n# a command is safe, so check will be passed\n\ncommand.replace("evil_command") # BYPASS THE CHECK\n\nrunner.run # runs evil_command, that is not safe\n\nThe same can be done to fields of instances, which are exported as\nread-only (attr_reader). I know there is a way to fix it (using .clone\nor .dup), but what is the reason Ruby has non-constant strings, as most\nlanguages (Java, Python) do? Is there a way to disable such behaviour\n($SAFE will not help, because internal class methods will not be able to\nchange instance-variable strings too).