In article <ca19f32e0603142317y1b97a5c9k / mail.gmail.com>,
Daniel Baird <danielbaird / gmail.com> wrote:
>------=_Part_6549_12041498.1142407055374
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: quoted-printable
>Content-Disposition: inline
>
>I'm guessing it's got something to do with your assignment
>
>                        table[a]=3Dt
>
>the array that is the hash's default can be assigned to.  I think that's
>what you're doing.  If i did some testing I might be more sure :)
>

Heh -- you can tell I'm new to ruby... (:-))

An hour after I posted I suddenly realized what is going on.
When you assign an array, the array is *not* copied!  the assigned-to
variable just gets a pointer to the other array.

So when I did "t=table[a]" I was setting t to a pointer to the default!
When I changed t[n], of course the default was actually what got changed...

Sigh.  Hardly a novel gotcha, but I fell right into it.

Not sure of the best way to do what I want -- maybe just use 'has_key?'
and then do the right thing.
					-- Pete --