Project

General

Profile

Bug #6600

Should Module#constants retain insertion order?

Added by hasari (Hiro Asari) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-06-16 trunk 36115) [x86_64-darwin11.4.0]
Backport:
[ruby-core:45678]

Description

=begin
This is pointed out in ((URL:http://bugs.jruby.org/6733)).

Should (({Module#constants})) maintain the order in which the constants are defined?

irb(main):001:0> RUBY_DESCRIPTION
=> "ruby 2.0.0dev (2012-06-16 trunk 36115) [x86_64-darwin11.4.0]"
irb(main):002:0> module MyNamespace
irb(main):003:1> class First
irb(main):004:2> end
irb(main):005:1>
irb(main):006:1* class Second
irb(main):007:2> end
irb(main):008:1>
irb(main):009:1* class Third
irb(main):010:2> end
irb(main):011:1> end
=> nil
irb(main):012:0>
irb(main):013:0* p MyNamespace.constants
[:First, :Second, :Third]
=> [:First, :Second, :Third]
=end

History

Updated by nobu (Nobuyoshi Nakada) almost 7 years ago

  • Status changed from Open to Closed

No.

Also available in: Atom PDF