werner
9/7/2007 7:18:00 AM
Il Thu, 6 Sep 2007 21:00:20 +0900, Ruby Quiz ha scritto:
> The three rules of Ruby Quiz:
>
> 1. Please do not post any solutions or spoiler discussion for this quiz until
> 48 hours have passed from the time on this message.
I hope what I'm writing doesn't break this rule ^^
A couple of newbie questions: I understand that Ruby hashes copy both the
key and the value in their internal table, is this right? And if it is, is
there a way to avoid copying that key, especially if the key is a String
(or a library that implements a different hash system?)
Second question: is the value always stored as a pointer to the existing
object, or is a new object also created for the hash table?
And third... (now you are all going to realize what kind of languages I
used to program in ^^;;) I understand that the object_id is somehow
connected to the pointer to the actual structure holding object data, if it
isn't the pointer itself. Is there a way to use it as an actual object
pointer? (I guess there isn't, but....)
Thanks in advance
--
Dawn is near, the time is short. (Human aircraft! Hard to port!)
We eight reindeers of the night work as one in silent flight.
Let not one damn house pass by. (Who taught that guy how to fly?)
Each year brings more girls and boys. How many of them can we bring toys?