In Ruby or Python can the very idea of Class be rewritten?

Posted by John Berryman on Stack Overflow See other posts from Stack Overflow or by John Berryman
Published on 2010-05-23T00:06:10Z Indexed on 2010/05/23 0:10 UTC
Read the original article Hit count: 206

Filed under:
|
|
|
|

Howdy All... first time at stack overflow.

I'm looking into using some of the metaprogramming features provided by Ruby or Python, but first I need to know the extent to which they will allow me to extend the language. The main thing I need to be able to do is to rewrite the concept of Class. This doesn't mean that I want to rewrite a specific class during run time, but rather I want to make my own conceptualization of what a Class is. To be a smidge more specific here, I want to make something that is like what people normally call a Class, but I want to follow an "open world" assumption. In the "closed world" of normal Classes, if I declare Poodle to be a subclass of Dog to be a subclass of Animal, then I know that Poodle is not going to also be a type of FurCoat. However, in an open world Class, then the Poodle object I've defined may or may not be and object of type FurCoat and we won't know for sure until I explain that I can wear the poodle. (Poor poodle.) This all has to do with a study I'm doing concerning OWL ontologies.

Just so you know, I've tried to find information online, but due to the overloading of terms here I haven't found anything helpful.

Super thanks, John

© Stack Overflow or respective owner

Related posts about python

Related posts about ruby