[plt-scheme] "appending" to classes rather than extending

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Mar 5 15:58:56 EST 2008

You could achieve this kind of effect (via units) but re-definitions  
in a module (and that's what this boils down to) of the same name are  
frowned upon in Scheme. -- Matthias

P.S. Re-definitions at the top-level have been around for a LONG time  
and there is a reason why Schemers are moving away from that approach.

On Mar 5, 2008, at 3:41 PM, Rob Hunter wrote:

> Hi all,
>
> I'm looking to be able to append a few methods to a class.  In Ruby, I
> can do something like this:
>
> class Foo
>   def bar
>     ...
>   end
>   ...
> end
>
> class Foo
>   def baz
>     ...
>   end
> end
>
> and both bar and baz will be a part of Foo (these two class defs could
> be in the same file, or in two different files that are both loaded).
> Anything like this in the PLT Scheme class system?
>
> Thanks,
> Rob
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.