[plt-scheme] Defining and adding member functions at the REPL
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