[plt-scheme] Defining and adding member functions at the REPL

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Jun 22 09:22:57 EDT 2009


On Jun 22, 2009, at 9:06 AM, Matthew Flatt wrote:

> At Thu, 18 Jun 2009 12:57:41 +1100, Greg Santucci wrote:
>> Functions can be added and redefined freely at runtime at the  
>> REPL. However,
>> I can't figure out how to change member function definitions at  
>> the REPL. Is
>> there a way to do this?
>
> No, there's not currently any way to change the methods in an existing
> class.

Set up a protocol and call the extension methods via this protocol:


  (send o dyn-added-methods 'm args ...)

where dyn-added-methods dispatches on 'm. And introduce a macro called
(send* ...) which does the quoting. -- Matthias



Posted on the users mailing list.