New meta class sematics?

Hi,

with a cvs change on oct 24 ruby cannot create ``higher order’'
meta-classes anymore. That is assuming

class Object
def meta(n= 1)
if n == 0
self
else
class << self; self end.meta(n-1)
end
end
end

then

klass.meta(n) == klass.meta(1) # true

for all Class objects klass and n >= 1. I agree that ``higher order’'
meta classes made little sense but wouldn’t it be simpler just to
raise an exception if one tries to create such classes?
To argue that a meta-class is it’s own meta-class seems odd to
me and was never (well, at least in the recent past) true until a
couple of days ago.

/Christoph

Hi,

with a cvs change on oct 24 ruby cannot create ``higher order’’
meta-classes anymore. That is assuming

class Object
def meta(n= 1)
if n == 0
self
else
class << self; self end.meta(n-1)
end
end
end

then

klass.meta(n) == klass.meta(1) # true

I didn’t make any change related to metaclass on Oct 24 last year.
You mean Sep 4, maybe?

Since then, I fixed several bugs, so that

for n in 1…5
p String.meta(n) == String.meta(1)
end

prints

true
false
false
false
false

Is this what you expect?

						matz.
···

In message “New meta class sematics?” on 02/09/28, “Christoph” chr_news@gmx.net writes:

“Yukihiro Matsumoto” matz@ruby-lang.org wrote in message
news:1033178494.207985.17454.nullmailer@picachu.netlab.jp…

Hi,

with a cvs change on oct 24 ruby cannot create ``higher order’’
meta-classes anymore. That is assuming

class Object
def meta(n= 1)
if n == 0
self
else
class << self; self end.meta(n-1)
end
end
end

then

klass.meta(n) == klass.meta(1) # true

I didn’t make any change related to metaclass on Oct 24 last year.
You mean Sep 4, maybe?

Sorry for begin my confused self. I miss-read the date
(I was using cvs -web)

Since then, I fixed several bugs, so that

Thanks!

for n in 1…5
p String.meta(n) == String.meta(1)
end

prints

true
false
false
false
false

Yes that is okay - with the seb-27 I get the same
thing (with seb -23 it was true, true, true, … ).

/Christoph

···

In message “New meta class sematics?” > on 02/09/28, “Christoph” chr_news@gmx.net writes: