Actions
Bug #3769
closedRemoving Predefined Constants
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-08-30 trunk 29147) [i686-linux]
Backport:
Description
=begin
The documentation for Module#remove_const states "Predefined classes and singleton objects (such as true) cannot be removed", but I believe the example below illustrates that they can. Is this a documentation or implementation bug?
run@paint:~ → cat /tmp/remove_const.rb
Module.constants.grep(/(?<!Object)$/).tap do |c|
c.each {|_| Object.class_eval{ remove_const } }
p c.select{|| Object.const_defined? _}
end
run@paint:~ → ruby -vw /tmp/remove_const.rb
ruby 1.9.3dev (2010-08-30 trunk 29147) [i686-linux]
[]
=end
Files
Actions
Like0
Like0Like0Like0