[Edu-sig] Gutless classes

Catherine Letondal letondal at pasteur.fr
Tue Sep 13 07:44:55 CEST 2005


Hi,

On Sep 8, 2005, at 7:42 PM, Kirby Urner wrote:

>
> I'm thinking about how, in Ruby, class definitions are never closed, 
> meaning
> you can add methods to a script in various locations.  You don't 
> supersede
> the old class def when you reopen it for more stuff.  There's also 
> this idea
> of defining a module full of methods and then binding those to a class 
> -- I
> haven't really learned this fully yet.
>
>

A good reason to extend a class at run-time, either by adding a new 
method or by redefining an existing one, is for customization by a 
knowledgeable end-user of an application (people like you and me are 
sometimes end-users of others'programs, aren't they?). This is for 
example the case for scientists (I work with biologists): they are not 
programmers, but they have sometimes enough programming experience for 
such adaptation. When methods are defined as small and modular, it's 
very convenient to be able edit them -- for instance to add a 
conditional, or to add a method that you are able to call from a GUI 
that opens access to the Python interpreter.

[Another language that can extends a class at run-tim is XOtcl 
(www.xotcl.org), developped as an extension of MIT Otcl]

Best,

--
Catherine Letondal -- Institut Pasteur
www.pasteur.fr/~letondal



More information about the Edu-sig mailing list