John wrote:
> You would then need to add something else (probably the
> class name) to
> indicate what it was you were constructing eg. new
> ClassName.construct(). This isn't as neat as just writing
> new ClassName().
I don't know any C++, but in the Ruby language you could
write something like this:
class Thing
def initialize
# do setup here
end
# other methods...
end
a_thing = Thing.new
Construction is done in two stages (if I understand
correctly). The 'new' method actually brings a Thing object
into being. Then the 'initialize' method runs automatically
if it exists, and sets things up the way the programmer
wants.
But of course Ruby isn't C++.
David