Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Sequence of Module#instance_methods #277

Closed
kachick opened this Issue Aug 31, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

kachick commented Aug 31, 2012

MRI/YARV looks to keep sequence of methods defined.

results = 10000.times.map do
  chars = ('A'..'Z').map(&:to_sym).shuffle

  cls = Class.new do

    chars.each do |chr|
      define_method(chr) {}
    end

  end

  chars == cls.instance_methods.take(26)
end

p results.all?{|o|o.equal? true}

MRI/YARV

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]

true

JRuby

jruby 1.7.0.preview2 (1.9.3p203) 2012-08-31 aeef1b8 on Java HotSpot(TM) 64-Bit Server VM 1.6.0_33-b03-424-11M3720 [darwin-x86_64]

false
Owner

BanzaiMan commented Oct 13, 2012

I tend to think this is implementation detail, and has no bearing on the language specifications.

All the same, I opened the ticket here: http://bugs.ruby-lang.org/issues/7152

Owner

BanzaiMan commented Oct 15, 2012

As suspected, this is not a bug.

@BanzaiMan BanzaiMan closed this Oct 15, 2012

Contributor

kachick commented Oct 15, 2012

Thank you for sharing that with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment