From: ts Date: 2004-06-26T20:06:44+09:00 Subject: Re: class= and type checks when casting >>>>> "S" == Sean O'Dell writes: S> The implementation I came up with allows you to do silly things like: Why you don't try to solve the *real* problem. Just to give you an example svg% grep rb_define_class ext/dbm/dbm.c rb_cDBM = rb_define_class("DBM", rb_cObject); rb_eDBMError = rb_define_class("DBMError", rb_eStandardError); svg% Now if you write require 'dbm' a = [] a.class = DBM this can't work because the type associated with DBM (T_DATA) is incompatible with the type associated with Array (T_ARRAY) and when matz has written dbm.c, he has never given the information that the type associated with DBM was T_DATA (look at rb_define_class("DBM", rb_cObject)) You have not yet understood that if evil.rb (which is really misnamed) can work this is just because (I suppose, I've not looked at the source) it work with only *one* type T_OBJECT (which is a little special). If it try to avoid String, Array, ... this is just to eliminate classes which create a type. Guy Decoux