Skip to content

Instantly share code, notes, and snippets.

@denis
Created September 30, 2009 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denis/197861 to your computer and use it in GitHub Desktop.
Save denis/197861 to your computer and use it in GitHub Desktop.
# 0: false
# 1: 0
# 2: true
# 3: 1
# 4: nil
# 5: 2
# ...
# 338: :"!"
# 378: :%
# 388: :&
# 428: :*
# 438: :+
# 458: :-
# 478: :/
(0..20_000).to_a.each do |id|
begin
object = ObjectSpace._id2ref(id)
puts "#{id}: #{object.inspect}" unless object.is_a? Fixnum
rescue RangeError
end
end
# >> :"!".object_id
# => 338
# >> :"!".to_i
# => 33
# >> :%.object_id
# => 378
# >> :%.to_i
# => 37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment