From: "nobu (Nobuyoshi Nakada)" Date: 2012-06-03T23:19:31+09:00 Subject: [ruby-core:45404] [ruby-trunk - Bug #6538] Mutability of Rational and Complex Issue #6538 has been updated by nobu (Nobuyoshi Nakada). Marshal compatibilities for Complex and Rational are already broken, since the time they were built in. ---------------------------------------- Bug #6538: Mutability of Rational and Complex https://bugs.ruby-lang.org/issues/6538#change-26993 Author: marcandre (Marc-Andre Lafortune) Status: Open Priority: Low Assignee: tadf (tadayoshi funaba) Category: core Target version: ruby -v: r35875 I hesitated to report this, but there is a "hole" in the immutability of Rational & Complex: r = Rational(0) # Rationals are immutable r.freeze # but let's be certain and freeze it! magic_trick(r) # r is now changed: r # => (1/42) The same thing occurs with Complex. I've left out the definition of `magic_trick` for anyone who wants to try and figure it out, but it's here: http://pastie.org/4016117 Is this worth fixing? -- http://bugs.ruby-lang.org/