[#4567] Re: What's the biggest Ruby development? — Aleksi Niemel<aleksi.niemela@...>

Dave said:

18 messages 2000/08/23
[#4568] Q's on Marshal — Robert Feldt <feldt@...> 2000/08/23

[#4580] RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/25

[#4584] Re: RubyUnit testcase run for different init params? — Dave Thomas <Dave@...> 2000/08/25

Robert Feldt <feldt@ce.chalmers.se> writes:

[#4623] Re: RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/28

On Sat, 26 Aug 2000, Dave Thomas wrote:

[#4652] Andy and Dave's European Tour 2000 — Dave Thomas <Dave@...>

24 messages 2000/08/30
[#4653] Re: Andy and Dave's European Tour 2000 — matz@... (Yukihiro Matsumoto) 2000/08/30

Hi,

[#4657] Ruby tutorials for newbie — Kevin Liang <kevin@...> 2000/08/30

Hi,

[ruby-talk:4705] new, initialize, etc.

From: hal9000@...
Date: 2000-08-31 21:40:02 UTC
List: ruby-talk #4705
I'm seeking an overview of this stuff.

I am rather used to constructors and destructors (as in C++ and Java,
and Eiffel which I've only read about), though I don't object to the
way Ruby does things.

As I see it, new is typically a class method which invokes the
initialize method.

First of all, why? I guess I can understand new being a class method,
but why is initialize named differently? Why not just define new for
the class and put the initializing code in there?

Second, I've read a little about finalizing objects; I'm not sure why
or when to do it. And why do it that way, rather than just provide a
method to be called by the GC when the object dies?

Finally, how are BEGIN and END supposed to be used? I've read what they
do -- it seems to me they would be useful for modules -- but I don't
actually grasp them. Are they completely unrelated to the concept of
creating and destroying objects?

Hal


--
Hal Fulton


Sent via Deja.com http://www.deja.com/
Before you buy.

In This Thread

Prev Next