>>>>> "M" == Mauricio =?iso-8859-1?Q?Fern=E1ndez?= <Mauricio> writes:

M> It's impossible AFAIK within plain Ruby. You can however write an
M> extension to do so, by doing:

svg% cat inpf.c
#include <ruby.h>

static
VALUE
get_address(VALUE class, VALUE obj)
{
 return INT2NUM((long)obj);
}

void
Init_inpf()
{
 rb_define_method(rb_mKernel, "get_address", get_address, 1);
}
svg% 

svg% ruby -rinpf -e 'a = ""; p get_address(a); p 2*a.id'
1074371868
1074371868
svg% 


Guy Decoux

p.s. : inpf = "impossible n'est pas francais" :-)