< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #13983 has been reported by Eregon (Benoit Daloze).
----------------------------------------
Feature #13983: Rational and Complex should be frozen
https://bugs.ruby-lang.org/issues/13983
* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Since they basically are value types.
They also do not support #dup currently:
> 1r.dup
TypeError: can't copy Rational
from `initialize_copy'
> 1i.dup
TypeError: can't copy Complex
from `initialize_copy'
Changing their value can only be considered a semantic bug.
So, let's follow true/false/nil/Integer/Float and friends?
Not sure what #6538 was about but I think Marshal can just freeze after setting the values.
It's slightly incompatible if people do rational.instance_variable_set(:@foo, 1) or so,
but no more than on other now-frozen Numeric types and this kind of code seems highly undesirable.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>