From: Robert Klemme Date: 2006-05-02T01:53:29+09:00 Subject: Re: Shortcut for [string].pack("p*").unpack("l").first ? 2006/5/1, Berger, Daniel : > Hi all, > > If I want to get the underlying pointer address of a > Ruby string, I can do this: What do you want with a memory address in Ruby-land? If you're in an extension then there's probably an easier way to get at the address. > string = "hello" > [string].pack("p*").unpack("l").first # 43329024 > > I thought there was a shortcut for this. Originally I thought > perhaps object_id was identical, but that doesn't seem to be > the case. Maybe that was immediate types only. If you want to identify an individual object then of course object_id is the appropriate means. Kind regards robert -- Have a look: http://www.flickr.com/photos/fussel-foto/