On Thu, 2003-08-07 at 15:26, Rudolf Polzer wrote:

> Perl, for example, has pointers:
> 
>   my $x = 17;
>   my $ptr = \$x; # <-- THAT's the thing which is missing in Ruby!
>   ${$ptr} = 42;

Actually, you can get pretty close ...

  x = 17
  ref = Ref.new{:x}
  p x                # => 17
  p ref.value        # => 17
  
  x = 10
  p x                # => 10
  p ref.value        # => 10
  
  ref.value = 42
  p x                # => 42
  p ref.value        # => 42

I'll post the source for Ref is another posting for those that wish to
puzzle over it before seeing the solution.

-- 
-- Jim Weirich       jweirich / one.net      http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct, 
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)