From: nobu@... Date: 2006-06-23T10:04:58+09:00 Subject: Re: Using pack/unpack to go from string to address and back to string Hi, At Fri, 23 Jun 2006 02:06:26 +0900, Daniel Berger wrote in [ruby-talk:198559]: > > It's disallowed. If it were possible, you could get an illegal > > "String." For instance: > > > > [1].pack('l').unpack('p*') > > > > > Would it be possible to make an exception for strings (char pointers)? How can you tell if it is a valid pointer? Use DL::Ptr if you really sure, at your own risk. > Or is there no way to determine the type of underlying object in time? Basically, no way to determine what a bare memory chunk is. -- Nobu Nakada