From: "Eustáquio Rangel de Oliveira Jr." Date: 2005-07-02T18:52:12+09:00 Subject: Re: How and where Fixnum are created -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hey Daniel. | Basically just the string data and a pointer to the String class. Fine! | Just the memory for the data. The methods are still needed because | there are other strings around. Ok! | No, this is not how it works. That would be terribly inefficient. Yes, I know, just asked to be sure ehehe. :-) |>I think it should be first one, specially when we change the String |>class at runtime and it changes all the String references, but I'm |>asking just to be sure. :-) | You are correct. :-) Cool! :-) | No, what happens is more like this: | n1 = 0x00000003 | Fixnum | | n2 = 0x00000005 | succ | | +---------+ | The `n1' and `n2' variables don't reference any _actual_ objects. | Ruby pretends the objects are there so we can feel warm and fuzzy. | It would be too inefficient to allocate a separate memory block for | each and every small integer out there. Perfect! | The truth is | that I needed to freshen up a bit on this myself. :-) It's what is happening to me trying to understand it more deeper. I talked with some guys about Fixnum and they asked (and will ask more) how it works internally, so it's curious how we learn (and remember, on your case) about things talking about them. :-) | Ah, yes, that's annoying. Man pages, in particular, tend to be | replicated across so many pages that they pollute search results. | One copy is quite enough please. I have a 150 pages Ruby tutorial here and will write about what we talked here. At least it can be a little different from the rest. Thanks Daniel, Dominik and Robert for your explanation about that. I think I got the idea of how it works. :-) Best regards, - ---------------------------- Eustáquio "TaQ" Rangel eustaquiorangel@yahoo.com http://beam.to/taq Usuário GNU/Linux no. 224050 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCxmQFb6UiZnhJiLsRAiy7AJ9jkz0L1eFqdMVz10bh6XZKSoILtwCfaryj cBmMrMflZRarSQoruxtpKgw= =pX4c -----END PGP SIGNATURE-----