Hi,

I consider the `wrap-as-wct!' method a bit too specific.  It is the only
way one can use a wrapset-specific implementation of <gw-wct>.  For
instance, <gw-guile-wct> is _not_ exported, so the only way to
instantiate a <gw-guile-wct> is using `wrap-as-wct!'.

However, it may sometimes be useful to subclass <gw-wct> in order to
define more specific behavior while still re-using the (Guile-specific)
<gw-wct> code, like:

  (define-class <my-object-type> (<gw-wct>))

  (define-method (destroy-value-cg (type <my-object-type>)
                                   (val <gw-value>) err)
    (list (next-method) "\n"
          "{ my_object_destroy (" (var val) "); }\n"))

However, since <my-object-type> doesn't inherit from <gw-guile-wct>,
methods like `wrap-value-function-cg' defined for the <gw-guile-wct>
class are not applicable to <my-object-type>.

Therefore, the user is mostly left with two choices:  either copy/paste
those methods, or stick to the simple `wrap-as-wct!', in which case it
becomes impossible to insert, for instance, specific destruction code.

One possibility would be to export <gw-guile-wct> and the likes, or have
a method like `wrapset-subclass-for' that returns the sub-class of a
given class for a given wrapset:

  (wrapset-subclass-for my-guile-wrapset <gw-wct>)

  |= <gw-guile-wct>

What do you think?

Thanks,
Ludovic.


_______________________________________________
g-wrap-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/g-wrap-dev

Reply via email to