< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事
N :次の記事(スレッド移動)
|<:スレッドの先頭
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Is it intentional?
###
class IntegerMimic
def initialize n
@n = n
end
def to_int
@n
end
end
obj = IntegerMimic.new(10)
%w(& | ^).each{|sym|
p sym
begin
p(3.send(sym, obj))
rescue => e
p e
end
}
#=>
ruby 1.9.4dev (2011-09-11 trunk 33248) [i386-mswin32_100]
"&"
#<TypeError: can't convert IntegerMimic into Integer for bitwise arithmetic>
"|"
#<TypeError: can't convert IntegerMimic into Integer for bitwise arithmetic>
"^"
#<TypeError: can't convert IntegerMimic into Integer for bitwise arithmetic>
(2011/08/29 7:25), Kenta Murata wrote:
>
> Issue #1792 has been updated by Kenta Murata.
>
> Status changed from Assigned to Closed
>
> ごめんなさいごめんなさい。
> r33113 で修正しました。
>
> ----------------------------------------
> Bug #1792: Fixnum#& 等が、Rational などを受けつける
> http://redmine.ruby-lang.org/issues/1792
>
> Author: tadayoshi funaba
> Status: Closed
> Priority: Normal
> Assignee: Kenta Murata
> Category:
> Target version: 1.9.x
> ruby -v: -
>
>
> =begin
> 1 & 1.5 がエラーになるので、
> 1 & Rational(3,2)
> や
> 1 & BigDecimal('1.5')
> もエラーにすべきかもしれません。
> =end
>
>
>
--
// SASADA Koichi at atdot dot net