Say I want to convert a simple rectangle class to a different one, such
as the gdk:rectangle class to be used in a wrapper.
(change-class my-rectangle 'gdk:rectangle)
The problem here is that the gdk wrapper library specifies its own
meta-class for gdk:rectangle, instead of using standard-class. This
means that the method selection for change-class fails.
How could I work around this problem? I'm guessing it starts at
providing a new method for the non-standard-class class, but I'm at a
loss how to proceed any further.
thanks!
-Yves Vandriessche
Yves Vandriessche wrote:
> Say I want to convert a simple rectangle class to a different one, such
> as the gdk:rectangle class to be used in a wrapper.
>
> (change-class my-rectangle 'gdk:rectangle)
>
> The problem here is that the gdk wrapper library specifies its own
> meta-class for gdk:rectangle, instead of using standard-class. This
> means that the method selection for change-class fails.
That doesn't necessarily have to be the case. How is change-class
specialized?
> How could I work around this problem? I'm guessing it starts at
> providing a new method for the non-standard-class class, but I'm at a
> loss how to proceed any further.
I see the following possible workarounds:
- Use that other metaclass for your own rectangle class.
- Ask the provider to use standard-class.
- Use a wrapper object. Then you can replace the old instance with a new
instance, instead of using change-class.
But I don't see yet why change-class would fail.
Pascal
--
3rd European Lisp Workshop
July 3 - Nantes, France - co-located with ECOOP 2006
http://lisp-ecoop06.bknr.net/