[EVALUATION] - E03d - The Ruby Object Model (End Game)

Chris Pine wrote:

How do I include the construct:

(class<<Object; self; end)

conveniently into the definition of "Class"?

Oh. My. God.

I can't believe you just asked that.

[...]

of course.

and I got the concise and compact answer.

Which led me to the simple solution.

[btw: the thread "[ANN] Article: Seeing Metaclasses Clearly" came 2 weeks after my initial thread. But the documentation is anyway to complex.]

···

-

And I know now:

"ri class" documentation is missleading.

and: it is false.

[but I'm to exhausted to elaborate on this]

-

the time budget for ruby is gone.

sorry.

..

--
http://lazaridis.com

Chris Pine wrote: (quoting a troll)

How do I include the construct:

(class<<Object; self; end)

conveniently into the definition of "Class"?

Oh. My. God.

I can't believe you just asked that. How many thousands of lines ago
were people urging you PLEASE go read something really intelligent
answering exactly your questions?

I think he was not expecting to get an answer to this question. When other languages have constructs like this the answer usually is "You can't do this" which would have given him a perfect reason for bitch-slapping Ruby. It didn't work out and I think he is not really interested in the solution as long as there is one.

Great!

the time budget for ruby is gone.

···

On 4/20/05, Ilias Lazaridis <ilias@lazaridis.com> wrote:

sorry.

--
Bill Atkins

Ilias Lazaridis wrote:

And I know now:

"ri class" documentation is missleading.

and: it is false.

I'm probably going to be shot by the rest of the mailing list members for
continuing this, but I learned from this so hopefully others will as well:

irb(main):001:0> ObjectMetaClass = class<<Object;self;end
=> #<Class:Object>
irb(main):002:0> ObjectMetaClass.superclass
=> Class
irb(main):003:0> ClassMetaClass = class<<Class;self;end
=> #<Class:Class>
irb(main):004:0> ClassMetaClass.superclass
=> #<Class:Module>
irb(main):005:0> ClassMetaClass.superclass.superclass
=> #<Class:Object>
irb(main):006:0> ClassMetaClass.superclass.superclass.superclass
=> Class
irb(main):007:0> ObjectMetaClass.class
=> Class
irb(main):008:0> ClassMetaClass.class
=> Class
irb(main):009:0> ModuleMetaClass = class<<Module;self;end
=> #<Class:Module>
irb(main):010:0> ModuleMetaClass.superclass
=> #<Class:Object>
irb(main):011:0> ModuleMetaClass.superclass.superclass
=> Class
irb(main):012:0> ModuleMetaClass.class
=> Class
irb(main):013:0> StringMetaClass = class<<String;self;end
=> #<Class:String>
irb(main):014:0> StringMetaClass.superclass
=> #<Class:Object>
irb(main):015:0> StringMetaClass.superclass.superclass
=> Class
irb(main):016:0> StringMetaClass.class
=> Class
irb(main):017:0> class Object;def metaclass;class<<self;self;end;end;end
=> nil
irb(main):018:0> Object.metaclass
=> #<Class:Object>
irb(main):019:0> Class.metaclass
=> #<Class:Class>

I feel this proves the diagram shown in "ri Class" is correct. Not that
*I* ever had any doubt.

Ryan

Well, see the thread

http://groups-beta.google.com/group/comp.lang.ruby/browse_frm/thread/dccac368e450ee18/d1e9611e8ac14dd1

and browse it 'till 8th post (which is avaiable separately as

http://groups-beta.google.com/group/comp.lang.ruby/msg/3aa2dbdfa6fbdbd5

).

This shows that you got your concise and compact answer already on 5th
of April, more than two weeks before. And no trace of the big mess which
your thread evolved into appears at this point, so don't say you were
overwhelmed then.

And you got the same answer a zillion times since then, in zillion
different forms.

You were just too fcknuig lazy to take the effort of understanding these
answers (or ask properly if you don't succeed).

You seem to work in a way that you browse through the answers quickly;
upon doing so some of the sentences ring a bell, others not, and that's
it. You don't seem to give a second chance to the posts, rather iterate
the above procedure, by asking essentially the same again. Bad, bad.

I understand you don't wanna learn ruby just evaluate it, but the above
sketched work method doesn't seem to be fruitful in this case either.

And btw, concerning your "Meta" method implementation, get rid of the
"@Meta ||=" part. It's not a gain in efficency, but a pain for the eye.

Csaba

···

On 2005-04-20, Ilias Lazaridis <ilias@lazaridis.com> wrote:

Chris Pine wrote:

How do I include the construct:

(class<<Object; self; end)

conveniently into the definition of "Class"?

Oh. My. God.

I can't believe you just asked that.

[...]

of course.

and I got the concise and compact answer.

Which led me to the simple solution.

[btw: the thread "[ANN] Article: Seeing Metaclasses Clearly" came 2
weeks after my initial thread. But the documentation is anyway to complex.]

Ryan Leavengood wrote:

Ilias Lazaridis wrote:

And I know now:

"ri class" documentation is missleading.

and: it is false.

I'm probably going to be shot by the rest of the mailing list members for
continuing this, but I learned from this so hopefully others will as well:

irb(main):001:0> ObjectMetaClass = class<<Object;self;end
=> #<Class:Object>

[...]

irb(main):019:0> Class.metaclass
=> #<Class:Class>

I feel this proves the diagram shown in "ri Class" is correct.

no, this just prove that you can play with the irb.

Not that *I* ever had any doubt.

Ryan

..

···

--
http://lazaridis.com