I
Ilias Lazaridis
Lionel said:Ilias Lazaridis a écrit :
I can.
-
But there are other ways of asking, you know...
there are other ways of answering, too.
-
I'll give it a try: the documentation "ri Class" gives is not wrong at
all. Maybe not complete, but not wrong.
it's incomplete, wrong and missleading.
-
In "ri Class" text, if you replace references to "metaclasses" (which
are said to be between parentheses) by "singleton method placeholders",
perhaps it becomes clearer?
no, then it becomes completely confusing.
-
I remember that what was disturbing you was the stuff about metaclasses.
I told you ruby invite you to think more in terms of singleton method
than in terms of metaclasses. But it seems that you ignore what are
singleton methods.
of course i ignore them.
they are not relevant when reviewing ruby's oject-model.
-
Have you ever evaluated some classless OO langages? I know some: IO (
http://www.iolanguage.com/ ), Self ( http://c2.com/cgi/wiki?SelfLanguage
) and REBOL (rebol is not basically OO, but its OO part is classless.
http://www.rebol.com/ ). If you would, the concept of singleton method
would be far easier to understand for you. (this is actually how I
understood that concept)
[will possibly take a look at them shortly]
-
http://lazaridis.com/case/lang/ruby/TheRubyObjectModel.png
Your UML diagram of ruby object model is hard to read, and probably
wrong. The separation between classes in memory and in source code is
totally confusing.
the seperation exist in reality (and in the "ri class" documentation).
additionally: It was neccessary for my understanding process.
the next version (1.1), the diagramm will be simplified (possibly in a
few hours, if the stuff has passed).
In ruby, classes *are* objects.
yes, but there is still a class definition.
Learn more about
classless languages, and it should be far easier to understand these
concepts.
this is not relevant to understand ruby's Object Model.
I just need a (correct) UML diagram to understand Ruby's Object Model.
There is another evident mistake in your UML diagram. Object doesn't
inherit from nil, nil is a literal and an instance of NilClass which
inherit from Object.
you are wrong:
irb(main):001:0> Object.superclass
=> nil
irb(main):002:0> nil.class
=> NilClass
[btw: to simplify the analysis, I've stopped exporing "nil" at that point]
-
I tried my best, I can't say anymore. Please, don't ask me for lengthy
exhausting explanations. Try the languages I told you about, they are
really worth it.
will possibly do this shortly.
-
Have a nice day.
--
Lionel Thiry
PS: Please, anybody, do not blame me for anwsering this post. Do not
blame me for imitating Lazaridis posting. Do not blame me for trying to
be nice.
..