I don't understand.
no, you don't _want_ to understand.
Uh, I thought it was obvious that my response was automatically generated by a bot (emacs' psycodoctor).
martinus
I don't understand.
no, you don't _want_ to understand.
Uh, I thought it was obvious that my response was automatically generated by a bot (emacs' psycodoctor).
martinus
mark sparshatt wrote:
Ilias Lazaridis wrote:
Christian Neukirchen wrote:
Ilias Lazaridis <ilias@lazaridis.com> writes:
Ilias Lazaridis wrote:
an example for wrong ruby documentation:
-
cmd:> ri Class
"Classes, modules, and objects are interrelated. In the diagram that
follows, the arrows represent inheritance, and the parentheses
meta-classes. All metaclasses are instances of the class `Class'."+------------------+
> >
Object---->(Object) |
^ ^ ^ ^ |
> > > > >
> > +-----+ +---------+ |
> > > > >
> +-----------+ | |
> > > > >
+------+ | Module--->(Module) |
> > ^ ^ |
OtherClass-->(OtherClass) | | |
> > >
Class---->(Class) |
^ |
> >
+----------------+I do not see what's wrong here, can you explain?
definitive errors:
a) not all arrows represent inheritance, just the verticals.
b) the relation "(Object)"---[inherits from]--->"Class" is false.
correct: "(Object)"---[inherits-from]------->nil
As other people have pointed out this is wrong since nothing can inherit from nil, since it isn't a class.
simply rephrase to:
"Object inherits from nothing" or
"Object does not inherit".
The mistake you're making is that (Object) doesn't represent an instance of Object.
I understand.
Thus horizontal arrows represent inheritance, too.
Let's see.
It represents Object's metaclass.
again my initial question:
how do I access this metaclass?
Using _why's metaid library
this library is irrelevant.
I'm evaluating standard ruby and its Object Model.
The [Meta] Object Model must be accessible without additional libraries.
Object.metaclass.superclass #=> Class
output of pure ruby:
irb(main):014:0> Object.metaclass.superclass
NoMethodError: undefined method `metaclass' for Object:Class
from (irb):14
So the ruby documentation is correct, (Object) does inherit from Class
not in my installation:
I have no "(Object)"
or
correct: "(Object)"---[is-an-instance-of]--->Class
This is correct. (Object) both inherits from and is an instance of Class.
it's easier:
(Object) is not existent.
-
and finally:
the diagramm gives the impression, that "Object" and "(Object)" (etc.) are both classes,
Object and (Object) are both classes.
"Object" and "(Object)" are essentially the same thing.
which is of course false. There is a "definition" and an "(instance)".
no there is a "class" and a (metaclass)
there are no metaclasses in ruby.
If i'm wrong:
please show me the pure-ruby [no additional libraries] access-code.
-
The version 1.1 UML diagramm backups all my statements.
You can verify it with a standard ruby installation:
http://lazaridis.com/case/lang/ruby/
..
Carlos wrote:
We agree until now? "person.id()" will try to find "Person#id", then
"Object#id". "Person.attr_accessor" will try to find
"(Person)#attr_accessor", then "Class#attr_accessor", then
"Module#attr_accessor". First go to the right, then up until you find it.
And Ruby describes (Person)#attr_accessor as Person.attr_accessor:
class Person; end
def Person.attr_accessor() end
Person.method(:attr_accessor) # => #<Method: Person.attr_accessor>
Person.method(:new) # => #<Method: Class#new>
.method(:inject) # => #<Method: Array(Enumerable)#inject>
I think this notational difference helps in figuring out where a method truly comes from.
I think your explanation was a good one, even though in practice you can ignore the fact that meta classes are implemented by inserting the meta class before the physical class in the inheritance chain and that an object is thus an instance of its meta class.
Carlos wrote:
[Ilias Lazaridis <ilias@lazaridis.com>, 2005-04-19 04.04 CEST]
"Classes, modules, and objects are interrelated. In the diagram that
follows, the arrows represent inheritance, and the parentheses
meta-classes. All metaclasses are instances of the class `Class'."Well, yes. If I'm not mistaken, horizontal arrows represent "instance of".
not exactly, it's more a "becomes" relation:
"class definition" ----"becomes"----> "(class) instance"
(?) Please see (attempt to) explanation below. I got a bit enthused with the
ascii art, sorry, but it helped to my understanding of the issue, too.
[...] - (thorough elaboration)
I'm sorry, I cannot review this at this point.
[protection of own understanding process]
I have marked your message for a later review.
My apologies.
..
vruz wrote:
I wish I didn't have to but you have a clearly incorrect arrow
and label. This has been adequately proven by plenty of experts
on this list.which experts?
those who are unable to communicate their knowledge?
[REQUOTE]
e.g. due to commonly recognised terminology and notations?
[/REQUOTE]
Among others, people who are authors the of code you're profiting
from.
I'm not profiting from this code.
currently, it's documentation cost me just huge amounts of time.
Among others the highly respected creator of the Ruby language, who many here believe to be a genius and a person of excellent human qualities.
System designers should not document their own systems.
And if they see that their documentation causes problems:
then they should clarify things:
[EVALUATION] - E03d - The Ruby Object Model (End Game)
http://groups-beta.google.com/group/comp.lang.ruby/msg/ea9da543dc256b42?hl=en
Will you show us some minimal display of decency ?
this is not my task.
..
Ilias:
I've noted that there's been unflattering stuff being said both by you
and others. Whatever happens, I hope that nobody feels inhibited from
asking good ruby questions. That's the whole point of the list. I
think there's still no ruby-tutor, and ruby-forum.org is still down, so
ask away.
That being said, I doubt that anybody's going to spend hours filling
inyour ruby and python templates. That's your job. And maybe it's
time to read the Pickax carefully and start digging for yourself.
Nikolai Weibull wrote:
Ilias Lazaridis, April 18:
One should call Mr. Matz to review this.
Most possibly he's the only one who knows.
It seems that you don't anyway,
I've invested some time (whilst ignoring finally the current documentation) to create this UML diagramm:
http://lazaridis.com/case/lang/ruby/TheRubyObjectModel.png
I'm asking now for confirmation/feedback.
This is nothing special within serious software-development.
-
But as it looks, this community is incapable to do so (giving productive feedback).
..
Martin Ankerl wrote:
I don't understand.
no, you don't _want_ to understand.
Uh, I thought it was obvious that my response was automatically generated by a bot (emacs' psycodoctor).
I see.
Possibly the same bot has generated the the "ri class" documentation.
..
> Using _why's metaid library
this library is irrelevant.
I'm evaluating standard ruby and its Object Model.
The [Meta] Object Model must be accessible without additional libraries.
Accessing Object's metaclass:
meta_class_of_Object = class << Object; self; end
=> #<Class:Object>
meta_class_of_Object.class
=> Class
So, the metaclass of Object /does/ inherit from class.
Now we demonstrate that the object in meta_class_of_Object is really the
metaclass by defining a method on Object and finding the method added to its
metaclass:
meta_class_of_Object.instance_methods(false)
=> ["new", "allocate"]
def Object.method_only_in_Object(); puts "HI"; end
=> nil
meta_class_of_Object.instance_methods(false)
=> ["method_only_in_Object", "new", "allocate"]
Object.method_only_in_Object
HI
=> nil
On Tuesday 19 April 2005 06:39 am, Ilias Lazaridis wrote:
--
-- Jim Weirich jim@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
Ilias Lazaridis a écrit :
mark sparshatt wrote:
Ilias Lazaridis wrote:
Christian Neukirchen wrote:
Ilias Lazaridis <ilias@lazaridis.com> writes:
Ilias Lazaridis wrote:
Using _why's metaid library
this library is irrelevant.
I'm evaluating standard ruby and its Object Model.
The [Meta] Object Model must be accessible without additional libraries.
Just check this page then:
<http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html>
A little advice by the way. You should not say:
> this library is irrelevant.
>
> I'm evaluating standard ruby and its Object Model.
>
> The [Meta] Object Model must be accessible without additional libraries.
which shows a great lack of tact,
but instead:
> I'm evaluating standard ruby and its Object Model.
>
> The [Meta] Object Model must be accessible without additional libraries.
>
> Why would this metaid.rb be relevant for me?
which would be a bit better.
> Will you show us some minimal display of decency ?
this is not my task.
yeah, we noticed
> Will you show us some minimal display of decency ?
this is not my task.
You categorical homosapien!
Have you not expressed dismay when some community
doesn't respond to YOU with decency?
You've asked the community to treat you well; it asks
the same of you. Task schmask.
Regards,
Bill
P.S. No. 4. The Larch.
From: "Ilias Lazaridis" <ilias@lazaridis.com>
Ilias:
I've noted that there's been unflattering stuff being said both by you
and others. Whatever happens, I hope that nobody feels inhibited from
asking good ruby questions. That's the whole point of the list. I
think there's still no ruby-tutor, and ruby-forum.org is still down, so
ask away.That being said, I doubt that anybody's going to spend hours filling
inyour ruby and python templates. That's your job.
Please let the people decide.
Many simply provide this information.
and btw: this thread here has nothing to do with the templates.
And maybe it's
time to read the Pickax carefully and start digging for yourself.
Maybe it's time that you realize, that the ruby documentation is false:
http://lazaridis.com/case/lang/ruby/TheRubyObjectModel.png
I will not continue to read _any_ ruby documentation, until this issue here is clarified.
..
Ilias Lazaridis a écrit :
Nikolai Weibull wrote:
Ilias Lazaridis, April 18:
One should call Mr. Matz to review this.
Most possibly he's the only one who knows.
It seems that you don't anyway,
I've invested some time (whilst ignoring finally the current documentation) to create this UML diagramm:
http://lazaridis.com/case/lang/ruby/TheRubyObjectModel.png
I'm asking now for confirmation/feedback.
This is nothing special within serious software-development.
-
But as it looks, this community is incapable to do so (giving productive feedback).
I can.
-
But there are other ways of asking, you know...
-
I'll give it a try: the documentation "ri Class" gives is not wrong at all. Maybe not complete, but not wrong.
-
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?
-
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.
-
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)
-
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. In ruby, classes *are* objects. Learn more about classless languages, and it should be far easier to understand these concepts.
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.
-
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.
-
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.
Possibly the same bot has generated the the "ri class" documentation.
the schema in "ri class" was created by matz.
Guy Decoux
Hi --
Using _why's metaid library
this library is irrelevant.
I'm evaluating standard ruby and its Object Model.
The [Meta] Object Model must be accessible without additional libraries.Accessing Object's metaclass:
meta_class_of_Object = class << Object; self; end
=> #<Class:Object>
meta_class_of_Object.class
=> Class
So, the metaclass of Object /does/ inherit from class.
Doesn't that tell you that it is an instance of Class, rather than
that it inherits from Class? As opposed to:
irb(main):001:0> c = (class << Object; self; end)
=> #<Class:Object>
irb(main):002:0> c.superclass
=> Class
?
David
On Tue, 19 Apr 2005, Jim Weirich wrote:
On Tuesday 19 April 2005 06:39 am, Ilias Lazaridis wrote:
--
David A. Black
dblack@wobblini.net
Jim Weirich wrote:
[...] - (creating new context)
please, the context of the discussion is already given:
I've stated, that the _specific_ and _given_ (described within "ri Class") "(Object)" metaclass is not existent.
launch irb.
"Object" is accessible.
please name me the "(Object)" class.
you cannot:
it's not existent.
..
Lionel Thiry wrote:
[...]
which shows a great lack of tact,
[...]
your interpretation is irrelevant.
as takt is.
mastering the Ruby Object Model is relevant.
..
Lionel Thiry schrieb:
Ilias Lazaridis a écrit :
Nikolai Weibull wrote:
Ilias Lazaridis, April 18:
But as it looks, this community is incapable to do so (giving productive feedback).
I can't help it, this sounds too much like http://bash.org/?152037 to not make me laugh.
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.
I, for one, appreciate your effort very much, (even though I fear it's wasted).
Henrik
Ilias Lazaridis wrote:
and btw: this thread here has nothing to do with the templates.
Maybe it's time that you realize, that starting a thread doesn't mean owning it.