From: Madan Manoharan Date: 2006-05-19T23:30:37+09:00 Subject: Re: Question on GC Thanks, Matz. -Madan. On 5/19/06, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Question on GC" > on Fri, 19 May 2006 22:58:28 +0900, "Madan Manoharan" writes: > > |Does Ruby's GC treat a class variable (@@x) as 'global scope' or as > |'local scope'? > > Global, in a sense you use. > > |(1) Will 't' be garbage collected since the only reference to 't' is > |in @@x, which could go out of scope? > > No, class variables remain as it is, even after its scope ended. > > |(2) Is my understanding 'scope' correct? > > It's called 'extent' in GC field. Class variables have limited scope > and infinite extent. > > matz. > >