In [ruby-core:23856] matz explained that the Rational output, at least, is an intentional change "in preparation for Rational literals, which is planned for the future." Then, in [ruby-core:24731], matz wrote that he was no longer considering literals for imaginary numbers. I'm unsure what if any connection these two statements have.
That many objects with a literal syntax produce #inspect output is eval'able to the same object is a particularly useful characteristic, especially for code generation when you don't want Marshal's obfuscation. The changes in question prevent Complex and Rational being serialised in this fashion. In fact, in Rational's case the breakage is more subtle because the #inspect output is valid syntax, so integer division is performed silently:
eval Rational(7,2).inspect
=> 3
I suppose I have two questions:
Are Rational and Complex literals still planned? (If so, could we open a feature ticket to track the progress?)
Is it necessary that their #inspect output is changed preemptively?
=end
this is not a bug report.
this is not a matter for rational and complex.
close by yourself.
It was not my intention to cause offense or annoyance... :-/ In my experience the BTS is the most efficient and expedient way to seek clarification for issues concerning trunk development. If there's a preferred alternative, I'd appreciate a pointer. In any case, I can't close tickets.
In case I was simply unclear: Rational#inspect and Complex#inspect both exhibited this useful property previously. The change was predicated on the introduction of rational/complex literals. If said literals are still planned, this can be regarded as a request for confirmation and a tracking ticket, along with consideration of returning to the previous behavior in the interim. If they are not planned it can be regarded as a request for reconsidering the change in light of its premise being invalidated.
=end