On Sunday 06 March 2005 01:17 pm, ES wrote:

> Generally speaking, using an object this way might not be the best
> idea. If each Point were an immutable, unique instance (think Fixnum,
> for example), I would think it's OK but I'm somewhat leery of this.

Good points.  I see the example uses .freeze on the x and y attributes.  This 
freezes the objects referenced by @x and @y (and since the objects are 
Fixnum, this is a bit pointless. Fixnums are immutable anyways).  What it 
doesn't do is freeze the binding between @x/@y and those objects.  I'm 
guessing you really intended the following:

  def initialize(x,y)
    @x = x
    @y = y
    freeze  # Freeze the PointID object
  end

-- 
-- Jim Weirich    jim / weirichhouse.org     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)