From: "Ara.T.Howard" Date: 2004-06-26T02:53:03+09:00 Subject: Re: I am confused with Value Type Objects On Fri, 25 Jun 2004, Sam Sungshik Kong wrote: > Hello! > > In ruby, every object is reference type except for FixNum, NilClass, > TrueClass, FalseClass. > Let's consider FixNum only. > > According to http://www.rubygarden.org/ruby?GCAndMemoryManagement, FixNum > takes only 4 bytes (on 32-bit machines). > Is it true? > If so, doesn't it have any other information except for the value itself? > How does ruby know that a FixNum is actually a FixNum instead of a reference > to an object when it doesn't have any information about the type? > > I'm from C# background. > In C# (actually dotnet framework), values types are structures not just a > simple value. > > Could somebody resolve my confusion? > > Thanks. > > Sam only 31 bits. 1 bit is used as a flag to say "this is a ptr to object or it is an immediate value stored in word" -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================