[Ruby 1.8 - Backport #1915] const defined?の1.9との挙動の違いについて

Issue #1915 has been updated by Stefan Radomski.

Hello,

i have found that behavior in rubinius too. I fixed it, so that it
worked like ruby 1.9, but broke the compatibility with 1.8.
Will this be fixed in the next version of 1.8?

Backport #1915: const_defined?の1.9との挙動の違いについて

Author: Akira M.
Status: Assigned
Priority: Normal
Assignee: Akinori MUSHA
Category:
Target version:

=begin
以下の場合に
% cat const_defined.rb
class Alpha
class Beta; end
end

class Gamma < Alpha; end

puts Gamma::const_get(‘Alpha’)

puts Gamma::const_defined?(‘Alpha’)

1.8と1.9ではそれぞれこうなります。
% ruby18 -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9]
% ruby18 const_defined.rb
Alpha
false
% ruby19 -v
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-darwin9.7.0]
% ruby19 const_defined.rb
Alpha
true

1.9から仕様が変更されたということなのかな、と思うのですが、これは1.8.xにバックポートされる予定はあるのでしょうか?
=end

Hi,

In message “Re: [ruby-dev:43518] [Ruby 1.8 - Backport #1915]
const_defined?$B$N(B1.9$B$H$N5sF0$N0c$$$K$D$$$F(B”
on Wed, 11 May 2011 16:27:10 +0900, Stefan Radomski
[email protected] writes:

|i have found that behavior in rubinius too. I fixed it, so that it worked like
ruby 1.9, but broke the compatibility with 1.8.
|Will this be fixed in the next version of 1.8?

I am afraid there will be no “next version of 1.8”. 1.8.7 will be
maintained but there will be no room for incompatible changes.

          matz.