I notice that in Ruby 1.8 preview2, GC.start no longer
has the alias GC.garbage_collect (described on page 414
of the pickaxe book).
irb(main):001:0> GC.garbage_collect
NoMethodError: undefined method `garbage_collect’ for GC:Module
from (irb):1
irb(main):002:0> GC.start
nil
Is this deliberate?
Regards, Bret
Hi,
I notice that in Ruby 1.8 preview2, GC.start no longer
has the alias GC.garbage_collect (described on page 414
of the pickaxe book).
% ri garbage_collect
The method named `garbage_collect’ is not unique among Ruby’s classes
and modules:
GC#garbage_collect, ObjectSpace::garbage_collect
% ri GC#garbage_collect
----------------------------------------------------- GC#garbage_collect
garbage_collect → nil
···
In message “GC.garbage_collect” on 03/05/04, Bret Jolly oinkoink+unet@rexx.com writes:
Equivalent to GC::start.
include GC
garbage_collect #=> nil
See?
matz.
As for me, I still had to visit the docs before I
fully understood.
It’s a little unusual that two equivalent methods
should be defined at different levels. Usually
both are instance level or both class/module level.
I think that was what confused Bret.
Hal
···
----- Original Message -----
From: “Yukihiro Matsumoto” matz@ruby-lang.org
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, May 04, 2003 1:32 AM
Subject: Re: GC.garbage_collect
Hi,
In message “GC.garbage_collect” > on 03/05/04, Bret Jolly oinkoink+unet@rexx.com writes:
I notice that in Ruby 1.8 preview2, GC.start no longer
has the alias GC.garbage_collect (described on page 414
of the pickaxe book).
% ri garbage_collect
The method named `garbage_collect’ is not unique among Ruby’s classes
and modules:
GC#garbage_collect, ObjectSpace::garbage_collect
% ri GC#garbage_collect
----------------------------------------------------- GC#garbage_collect
garbage_collect → nil
Equivalent to GC::start.
include GC
garbage_collect #=> nil
See?
“Hal E. Fulton” hal9000@hypermetrics.com wrote in message news:0ee501c31209$5992bba0$0300a8c0@austin.rr.com…
···
----- Original Message -----
From: “Yukihiro Matsumoto” matz@ruby-lang.org
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, May 04, 2003 1:32 AM
Subject: Re: GC.garbage_collect
% ri garbage_collect
The method named `garbage_collect’ is not unique among Ruby’s classes
and modules:
GC#garbage_collect, ObjectSpace::garbage_collect
% ri GC#garbage_collect
----------------------------------------------------- GC#garbage_collect
garbage_collect → nil
Equivalent to GC::start.
include GC
garbage_collect #=> nil
See?
It’s a little unusual that two equivalent methods
should be defined at different levels. Usually
both are instance level or both class/module level.
I think that was what confused Bret.
I think that was it. Thanks for the help, guys.
Regards, Bret