From: Marnen Laibow-Koser Date: 2010-01-19T01:27:14+09:00 Subject: Re: basic question: passing a modifiable argument to a routi lalawawa wrote: > On Jan 18, 10:47�am, Rick DeNatale wrote: >> > them? �Isn't that horribly inefficient for just doing integer >> -- >> Rick DeNatale >> >> Blog:http://talklikeaduck.denhaven2.com/ >> Twitter:http://twitter.com/RickDeNatale >> WWR:http://www.workingwithrails.com/person/9021-rick-denatale >> LinkedIn:http://www.linkedin.com/in/rickdenatale > > Well, I'm trying to understand. If I do > > a = 0 > while a < 1_000_000 > a += 1 > end > > a.object_id at the end is 2000001. Does this mean a 2 million > instances of fixnum are in existance, just not garbage collected? You can think of it that way (1 million, actually -- Fixnums only use odd object_ids), but in fact Fixnums are implemented more efficiently than that, at least in MRI. You shouldn't run into performance issues with Fixnums. Best, --  Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.