RosettaCodeData/Task/Address-of-a-variable/Ruby/address-of-a-variable.rb
2023-07-01 13:44:08 -04:00

3 lines
119 B
Ruby

>foo = Object.new # => #<Object:0x10ae32000>
>id = foo.object_id # => 2238812160
>"%x" % (id << 1) # => "10ae32000"