[#3006] CVS repository — "Eugene Scripnik" <hoaz@...>

Hello.

21 messages 2004/06/16
[#3008] Re: CVS repository — ts <decoux@...> 2004/06/16

>>>>> "E" == Eugene Scripnik <hoaz@gala.net> writes:

[#3009] Re: CVS repository — Michal Rokos <michal@...> 2004/06/16

Hi!

[#3057] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)

Hi,

20 messages 2004/06/23

Re: class= and type checks when casting

From: ts <decoux@...>
Date: 2004-06-26 11:06:44 UTC
List: ruby-core #3094
>>>>> "S" == Sean O'Dell <sean@celsoft.com> 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

In This Thread